Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to calculate the inverse of matrix A.
MATLAB
B = [1](A); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent function like 'inverse' or 'invert'.
Misspelling the function name.
✗ Incorrect
The inv function in MATLAB calculates the inverse of a matrix.
2fill in blank
mediumComplete the code to compute the inverse of a 3x3 matrix M.
MATLAB
invM = [1](M); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect function names.
Trying to use functions that do not exist in MATLAB.
✗ Incorrect
Use inv to find the inverse of matrix M.
3fill in blank
hardFix the error in the code to correctly compute the inverse of matrix X.
MATLAB
Y = [1](X); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using misspelled function names.
Using non-existent functions.
✗ Incorrect
The correct MATLAB function to compute the inverse is inv.
4fill in blank
hardFill both blanks to create a matrix inverse and multiply it by the original matrix.
MATLAB
invA = [1](A); I = A [2] invA;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or subtraction instead of multiplication.
Using incorrect function names.
✗ Incorrect
Use inv to get the inverse, then multiply A by its inverse using *.
5fill in blank
hardFill all three blanks to compute the inverse of matrix B, multiply it by vector v, and store the result in x.
MATLAB
invB = [1](B); x = invB [2] v; result = [3];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Using wrong variable names.
Misspelling the inverse function.
✗ Incorrect
First, compute the inverse with inv, then multiply by v using *, and finally assign the product to result.