0
0
MATLABdata~20 mins

Matrix rank and null space in MATLAB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Matrix Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of matrix rank calculation
What is the output of the following MATLAB code?
MATLAB
A = [1 2 3; 4 5 6; 7 8 9];
r = rank(A);
disp(r);
A0
B3
C1
D2
Attempts:
2 left
💡 Hint
Think about the linear dependence of rows in matrix A.
Predict Output
intermediate
2:00remaining
Null space dimension of a matrix
What is the size of the null space of matrix B?
MATLAB
B = [1 0 0; 0 1 0; 0 0 0];
N = null(B);
disp(size(N, 2));
A2
B0
C1
D3
Attempts:
2 left
💡 Hint
The null space dimension equals the number of free variables.
🔧 Debug
advanced
2:00remaining
Identify the error in null space calculation
What error will this MATLAB code produce?
MATLAB
C = [1 2; 3 4];
N = null(C, 'r');
disp(N);
AError: Undefined function or variable 'null'
BError: Too many input arguments for null function
CNo error, outputs null space basis
DError: Matrix dimensions must agree
Attempts:
2 left
💡 Hint
Check the documentation for the null function's accepted arguments.
🧠 Conceptual
advanced
2:00remaining
Rank-nullity theorem application
Given a 4x5 matrix D with rank 3, what is the dimension of its null space?
A2
B3
C1
D4
Attempts:
2 left
💡 Hint
Use the formula: nullity = number_of_columns - rank.
Predict Output
expert
3:00remaining
Output of null space basis vectors
What is the output of this MATLAB code?
MATLAB
E = [1 2 3; 2 4 6; 3 6 9];
N = null(E);
disp(N);
A[ -0.8018; 0.2673; 0.5345 ]
B[ 0.2673; -0.8018; 0.5345 ]
C[ 0.5345; -0.8018; 0.2673 ]
D[ 0.5345; 0.2673; -0.8018 ]
Attempts:
2 left
💡 Hint
The null space basis vector is orthogonal to the rows of E.