Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to calculate the rank of matrix A.
MATLAB
r = [1](A); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
null instead of rank.Using
size which returns matrix dimensions, not rank.✗ Incorrect
The rank function returns the rank of matrix A.
2fill in blank
mediumComplete the code to find the null space of matrix B.
MATLAB
N = [1](B); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
rank instead of null.Using
inv which requires a square invertible matrix.✗ Incorrect
The null function returns a basis for the null space of matrix B.
3fill in blank
hardFix the error in the code to compute the rank of matrix C.
MATLAB
r = rank[1]C[2];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets or curly braces instead of parentheses.
Omitting parentheses entirely.
✗ Incorrect
Function calls in MATLAB require parentheses around the input argument, like rank(C).
4fill in blank
hardFill both blanks to create a dictionary (struct) of ranks for matrices M and N.
MATLAB
ranks.M = [1](M); ranks.N = [2](N);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
null for one or both blanks.Using
size or det which do not return rank.✗ Incorrect
Use rank to get the rank of both matrices M and N.
5fill in blank
hardFill all three blanks to compute rank, null space, and size of matrix P.
MATLAB
r = [1](P); n = [2](P); s = [3](P);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up
rank and null.Using
det instead of size.✗ Incorrect
Use rank for rank, null for null space, and size for dimensions of P.