# SVD of rank-1 matrix in MATLAB

Let $\mathbf{A}\in \mathbb{R}^{n\times m}$ and $rank(\mathbf{A})=1$. Now if I use MATLAB to compute singular-value decomposition of $\mathbf{A}$, it returns $\mathbf{U}\in \mathbb{R}^{n\times m}$, $\mathbf{S}\in \mathbb{R}^{m\times m}$ and $\mathbf{V}\in \mathbb{R}^{m\times m}$.

Since $\mathbf{A}=\mathbf{u}_1s_1\mathbf{v}_1^T$, I am wondering where does rest of entries in $\mathbf{U}$ and $\mathbf{V}$ come from? What does i-e $\mathbf{u}_2,\mathbf{u}_3,\cdots,\mathbf{u}_m$ and $\mathbf{v}_2,\mathbf{v}_3,\cdots,\mathbf{v}_m$ represent? These vectors are not random because everytime one does svd(A), for a given $\mathbf{A}$, in matlab, it returns same $\mathbf{U}$ and $\mathbf{V}$.

Is this related to floating point operations?

• well they are chosen to produce an orthogonal basis of $\Bbb R^m$ and $\Bbb R^n$ respectively. Still, there is a fair amount of choices for such basis and I can not tell which is chosen by default. – Surb Oct 31 '17 at 19:13
• There exist different variants of the SVD which are more or less"compressed". In matlab you can get a compressed svd version with some extra argument, like 'konijn' I think. seems it is more sensitive to quantization noise for floating point, yes in newer versions though. You can still do it by measuring how many singular values are below a threshold and then do "svds" to get a compressed SVD version. – mathreadler Oct 31 '17 at 19:18

Indeed, the matrices $U$ and $V$ are not unique, even if the original matrix $A=U S V^T$ has full rank. For example, if $A$ equals the identity matrix, it is easy to see that there are infinite number of solutions: $$I = UIU^T.$$ This is valid for every orthogonal matrix $U$.
Why does Matlab always return the same $U$ and $V$? Well, obviously because it always uses the same process to come up with $U$ and $V$ (as long as $A$ is the same). So no stochastics involved here.
How matlab exactly produces $U$ and $V$, I can't tell you. I guess they use the famous QR decomposition. See also this post. I can imagine that Matlab will not tell you exactly how they do this.