Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to multiply two matrices A and B.
MATLAB
C = A [1] B; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* instead of * for matrix multiplication.
✗ Incorrect
In MATLAB, the * operator performs matrix multiplication.
2fill in blank
mediumComplete the code to multiply matrix M by vector v.
MATLAB
result = M [1] v; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using element-wise operators instead of matrix multiplication operator.
✗ Incorrect
The * operator multiplies matrix M by vector v as a matrix multiplication.
3fill in blank
hardFix the error in multiplying matrices A and B.
MATLAB
C = A [1] B; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* which does element-wise multiplication causing dimension errors.
✗ Incorrect
Matrix multiplication requires the * operator, not element-wise .* operator.
4fill in blank
hardFill both blanks to compute the product of matrices X and Y and then add matrix Z.
MATLAB
result = X [1] Y [2] Z;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* for multiplication or - instead of + for addition.
✗ Incorrect
First multiply X and Y using *, then add Z using +.
5fill in blank
hardFill all three blanks to multiply matrices A and B, subtract matrix C, then multiply by matrix D.
MATLAB
output = (A [1] B [2] C) [3] D;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using + instead of - for subtraction or .* instead of * for multiplication.
✗ Incorrect
Multiply A and B with *, subtract C with -, then multiply the result by D with *.