Concept Flow - Matrix rank and null space
Start with matrix A
Calculate rank(A)
Calculate null space of A
Interpret results
End
We start with a matrix A, find its rank, then find its null space, and finally interpret what these results mean.
A = [1 2 3; 4 5 6; 7 8 9]; r = rank(A); N = null(A);
| Step | Action | Value/Result | Explanation |
|---|---|---|---|
| 1 | Define matrix A | [[1 2 3]; [4 5 6]; [7 8 9]] | Matrix A is set with 3 rows and 3 columns |
| 2 | Calculate rank(A) | 2 | Rank is 2 because rows are linearly dependent |
| 3 | Calculate null(A) | [[-1; 2; -1]] | Null space is a vector that satisfies A*x=0 |
| 4 | Interpret rank | 2 | Rank 2 means 2 independent rows/columns |
| 5 | Interpret null space | 1-dimensional | Null space dimension = number of columns - rank = 1 |
| 6 | End | - | Finished calculations |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | Final |
|---|---|---|---|---|---|
| A | undefined | [[1 2 3]; [4 5 6]; [7 8 9]] | [[1 2 3]; [4 5 6]; [7 8 9]] | [[1 2 3]; [4 5 6]; [7 8 9]] | [[1 2 3]; [4 5 6]; [7 8 9]] |
| r | undefined | undefined | 2 | 2 | 2 |
| N | undefined | undefined | undefined | [[-1]; [2]; [-1]] | [[-1]; [2]; [-1]] |
Matrix rank: number of independent rows/columns. Null space: vectors x where A*x=0. rank(A) + nullity(A) = number of columns. Use rank(A) and null(A) in MATLAB. Rank shows dimension of image space. Null space shows dependencies.
rank function in MATLAB tell you about a matrix?A?null(A) returns the null space vectors of matrix A.rank(A) gives rank, det(A) gives determinant, inv(A) gives inverse if it exists.A = [1 2 3; 2 4 6; 3 6 9], what is the output of rank(A) in MATLAB?A = [1 2 3; 4 5 6]; N = null(A); disp(size(N));
size(N)?B of size 4x5 with rank(B) = 3. Which MATLAB command gives the dimension of the null space of B?null(B) returns a matrix whose columns form a basis for the null space. The number of columns is the null space dimension. So size(null(B), 2) gives the dimension.Pass the test and this pattern moves unknown