Complete the code to create a 2x2 identity matrix.
I = eye([1]);The eye function creates an identity matrix of the specified size. Here, eye(2) creates a 2x2 identity matrix.
Complete the code to multiply two matrices A and B.
C = A [1] B;.* instead of * for matrix multiplication.Matrix multiplication in MATLAB uses the * operator. The .* operator does element-wise multiplication, which is different.
Fix the error in the code to compute the inverse of matrix M.
invM = [1](M);transpose instead of inv.The inv function computes the inverse of a matrix. Other functions like transpose, det, and rank do different operations.
Fill both blanks to create a vector v with elements from 1 to 5 and compute its norm.
v = [1]; norm_v = [2](v);
linspace without correct arguments.sum instead of norm.1:5 creates a vector with elements 1 to 5. The norm function computes the length (magnitude) of the vector.
Fill all three blanks to create a matrix A, compute its transpose, and then multiply A by its transpose.
A = [1]; At = [2](A); result = A [3] At;
sum instead of multiplication..* instead of *.[1 2 3] creates a row vector with elements 1 to 3. transpose flips rows and columns. Multiplying A by its transpose uses * for matrix multiplication.