Question: how does svd work in matlab?
Answer: svd (MATLAB Functions) The svd command computes the matrix singular value decomposition. s = svd(X) returns a vector of singular values. [U,S,V] = svd(X) produces a diagonal matrix S of the same dimension as X , with nonnegative diagonal elements in decreasing order, and unitary matrices U and V so that X = U*S*V'.