0
0
MATLABdata~10 mins

Matrix multiplication (*) in MATLAB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to multiply two matrices A and B.

MATLAB
C = A [1] B;
Drag options to blanks, or click blank then click option'
A+
B*
C.+
D.*
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* instead of * for matrix multiplication.
2fill in blank
medium

Complete the code to multiply matrix M by vector v.

MATLAB
result = M [1] v;
Drag options to blanks, or click blank then click option'
A+
B.*
C*
D.^
Attempts:
3 left
💡 Hint
Common Mistakes
Using element-wise operators instead of matrix multiplication operator.
3fill in blank
hard

Fix the error in multiplying matrices A and B.

MATLAB
C = A [1] B;
Drag options to blanks, or click blank then click option'
A.*
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* which does element-wise multiplication causing dimension errors.
4fill in blank
hard

Fill 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'
A*
B+
C-
D.*
Attempts:
3 left
💡 Hint
Common Mistakes
Using .* for multiplication or - instead of + for addition.
5fill in blank
hard

Fill 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'
A*
B-
C+
Attempts:
3 left
💡 Hint
Common Mistakes
Using + instead of - for subtraction or .* instead of * for multiplication.