0
0
MATLABdata~10 mins

Eigenvalues and eigenvectors (eig) 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 compute eigenvalues of matrix A.

MATLAB
A = [2 1; 1 2];
lambda = [1](A);
Drag options to blanks, or click blank then click option'
Adet
Brank
Cinv
Deig
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'inv' instead of 'eig' to compute eigenvalues.
Using 'det' which returns determinant, not eigenvalues.
2fill in blank
medium

Complete the code to compute eigenvectors of matrix B.

MATLAB
B = [4 0; 1 3];
[V, D] = [1](B);
Drag options to blanks, or click blank then click option'
Aeig
Binv
Csvd
Dchol
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'svd' which computes singular value decomposition, not eigenvectors.
Using 'chol' which computes Cholesky decomposition.
3fill in blank
hard

Fix the error in the code to correctly compute eigenvalues of matrix C.

MATLAB
C = [1 2; 3 4];
lambda = eig[1]C);
Drag options to blanks, or click blank then click option'
A(
B[
C{
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets or curly braces instead of parentheses.
Missing the opening parenthesis causes syntax error.
4fill in blank
hard

Fill both blanks to create a dictionary of eigenvalues and eigenvectors for matrix D.

MATLAB
D = [5 2; 2 5];
[V, [1]] = eig(D);
eigenvalues = diag([2]);
Drag options to blanks, or click blank then click option'
AD
BV
DV'
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning eigenvectors to the second output instead of eigenvalues.
Using the wrong variable inside diag function.
5fill in blank
hard

Fill all three blanks to compute eigenvalues and eigenvectors, then normalize eigenvectors of matrix E.

MATLAB
E = [3 1; 0 2];
[[1], [2]] = eig(E);
norm_vec = [3]( [1](:,1) );
Drag options to blanks, or click blank then click option'
AV
BD
Cnorm
Deig
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping eigenvectors and eigenvalues in assignment.
Using eig function instead of norm to normalize.