Bird
0
0

You want to approximate a matrix A by keeping only the largest singular value and corresponding vectors using MATLAB. Which code snippet correctly performs this low-rank approximation?

hard📝 Application Q15 of 15
MATLAB - Linear Algebra
You want to approximate a matrix A by keeping only the largest singular value and corresponding vectors using MATLAB. Which code snippet correctly performs this low-rank approximation?
A[U, S, V] = svd(A);<br>A_approx = U(:,1) * S(1,1) * V(:,1)';
B[U, S, V] = svd(A);<br>A_approx = U(:,1) * V(:,1)';
C[U, S, V] = svd(A);<br>A_approx = S(1,1) * V(:,1)';
D[U, S, V] = svd(A);<br>A_approx = U(:,1) * S(:,1) * V(:,1)';
Step-by-Step Solution
Solution:
  1. Step 1: Understand low-rank approximation using svd

    Keeping only the largest singular value means using the first column of U, the first singular value, and the first column of V.
  2. Step 2: Construct the approximation

    The approximation is A_approx = U(:,1) * S(1,1) * V(:,1)', multiplying the first singular value and vectors.
  3. Final Answer:

    [U, S, V] = svd(A); A_approx = U(:,1) * S(1,1) * V(:,1)'; -> Option A
  4. Quick Check:

    Low-rank approx = U(:,1)*S(1,1)*V(:,1)' [OK]
Quick Trick: Multiply first U column, singular value, and V column for approximation [OK]
Common Mistakes:
  • Omitting singular value in multiplication
  • Using entire S matrix instead of first singular value
  • Incorrect matrix dimensions in multiplication

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More MATLAB Quizzes