0
0
MATLABdata~20 mins

Matrix inverse (inv) in MATLAB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Matrix Inverse Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of matrix inverse multiplication
What is the output of this MATLAB code snippet?
MATLAB
A = [2 1; 5 3];
B = inv(A) * A;
A[1 0; 0 1]
B[0 1; 1 0]
C[2 1; 5 3]
DError: Matrix is singular
Attempts:
2 left
💡 Hint
Multiplying a matrix by its inverse results in the identity matrix.
Predict Output
intermediate
2:00remaining
Result of inverse on singular matrix
What happens when you run this MATLAB code?
MATLAB
A = [1 2; 2 4];
B = inv(A);
A[1 2; 2 4]
BError: Matrix is singular to working precision.
C[0.5 -0.25; -0.25 0.125]
DError: Matrix must be square.
Attempts:
2 left
💡 Hint
Check if the matrix has linearly dependent rows.
🔧 Debug
advanced
2:00remaining
Identify the error in matrix inverse calculation
What error does this MATLAB code produce?
MATLAB
A = [1 2 3; 4 5 6];
B = inv(A);
AError: Matrix must be square.
B[0.5 -0.5 0; -0.5 0.5 0]
C[1 0 0; 0 1 0; 0 0 1]
DError: Matrix is singular.
Attempts:
2 left
💡 Hint
Check the shape of the matrix before inversion.
Predict Output
advanced
2:00remaining
Inverse of a diagonal matrix
What is the output of this MATLAB code?
MATLAB
D = diag([4 5 6]);
E = inv(D);
AError: Matrix is singular.
B[4 5 6; 0 0 0; 0 0 0]
C[1 0 0; 0 1 0; 0 0 1]
D[0.25 0 0; 0 0.2 0; 0 0 0.1667]
Attempts:
2 left
💡 Hint
The inverse of a diagonal matrix is a diagonal matrix with reciprocal elements.
🧠 Conceptual
expert
2:00remaining
Properties of matrix inverse and multiplication
Given a nonsingular matrix A, which statement is TRUE?
Ainv(A + B) = inv(A) + inv(B)
Binv(A * B) = inv(A) * inv(B)
Cinv(A * B) = inv(B) * inv(A)
Dinv(A) * A = zeros(size(A))
Attempts:
2 left
💡 Hint
Recall the order of multiplication when inverting a product.