0
0
MATLABdata~10 mins

Why linear algebra is MATLAB's core - Test Your Understanding

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

Complete the code to create a 2x2 identity matrix.

MATLAB
I = eye([1]);
Drag options to blanks, or click blank then click option'
A3
B1
C4
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using a size other than 2 will create a matrix of wrong dimensions.
Forgetting that the identity matrix is square.
2fill in blank
medium

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.
Using addition or subtraction operators by mistake.
3fill in blank
hard

Fix the error in the code to compute the inverse of matrix M.

MATLAB
invM = [1](M);
Drag options to blanks, or click blank then click option'
Ainv
Bdet
Ctranspose
Drank
Attempts:
3 left
💡 Hint
Common Mistakes
Using transpose instead of inv.
Confusing determinant with inverse.
4fill in blank
hard

Fill both blanks to create a vector v with elements from 1 to 5 and compute its norm.

MATLAB
v = [1];
norm_v = [2](v);
Drag options to blanks, or click blank then click option'
A1:5
Bnorm
Csum
Dlinspace
Attempts:
3 left
💡 Hint
Common Mistakes
Using linspace without correct arguments.
Using sum instead of norm.
5fill in blank
hard

Fill all three blanks to create a matrix A, compute its transpose, and then multiply A by its transpose.

MATLAB
A = [1];
At = [2](A);
result = A [3] At;
Drag options to blanks, or click blank then click option'
A[1 2 3]
Btranspose
C*
Dsum
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum instead of multiplication.
Using element-wise multiplication .* instead of *.