0
0
MATLABdata~10 mins

Singular value decomposition (svd) 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 perform singular value decomposition on matrix A.

MATLAB
[U, S, V] = [1](A);
Drag options to blanks, or click blank then click option'
Aeig
Bdet
Cinv
Dsvd
Attempts:
3 left
💡 Hint
Common Mistakes
Using eigenvalue function eig instead of svd.
Trying to invert the matrix with inv.
2fill in blank
medium

Complete the code to extract the singular values from matrix A.

MATLAB
S = [1](A);
Drag options to blanks, or click blank then click option'
Arank
Beig
Csvd
Ddet
Attempts:
3 left
💡 Hint
Common Mistakes
Using eig which returns eigenvalues, not singular values.
Using rank or det which do not return singular values.
3fill in blank
hard

Fix the error in the code to compute the SVD of matrix B.

MATLAB
[U, S, V] = svd([1]);
Drag options to blanks, or click blank then click option'
Ab
BB
CB()
DB[]
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase b instead of B.
Adding parentheses or brackets after the variable name.
4fill in blank
hard

Fill both blanks to create a diagonal matrix of singular values and reconstruct matrix A.

MATLAB
S = diag([1]);
A_reconstructed = [2] * S * V';
Drag options to blanks, or click blank then click option'
As
BU
CV
DS
Attempts:
3 left
💡 Hint
Common Mistakes
Using S instead of the vector s for diag.
Using V instead of U for reconstruction.
5fill in blank
hard

Fill all three blanks to compute the reduced SVD of matrix M.

MATLAB
[[1], [2], [3]] = svd(M, 'econ');
Drag options to blanks, or click blank then click option'
AU
BS
CV
DE
Attempts:
3 left
💡 Hint
Common Mistakes
Using E which is not a standard output of svd.
Mixing the order of U, S, and V.