In Matlab, I have read a black & white image and converted its pixels into double values. Let's denote it by A ($300$ by $150$). I need to find the optimal rank-$1$ and rank-$10$ approximations of a matrix in Frobenius norm. I am a bit confused on the Frobenius norm part.
I used the command
k = svds(A,k) returns the k largest singular values.
Thus, I used
one = svds(A,1);
ten = svds(A,10);
However, how do I use the Frobenius norm so I can find the optimal rank-$1$ and rank-$10$ approximations?
EDIT: is it safe to say that the optimal rank 1 is basically my matrix S of my singular values but it has only the biggest value and the rest are zero? The same goes if I wanted rank 10 then the 10 biggest values and the rest zero? Thus just by doing the command svds I have basically have found the optimal approximation of rank 1(or 10)?
Use the command
[U,S,V] = svds(a,10). From there,U*S*V'is the best low-rank approximation. The same thing works for rank $1$.