%% Economy-Size Decomposition
% Calculate the complete and economy-size decompositions of a rectangular matrix.

A = [1 2; 3 4; 5 6; 7 8]

%

[U,S,V] = svd(A)

%

[U,S,V] = svd(A,"econ")

% Since A is 4-by-2, svd(A,"econ") returns fewer columns in U and fewer rows in S compared to a complete decomposition. Extra rows of zeros in S are excluded, along with the corresponding columns in U that would multiply with those zeros in the expression A = U*S*V'.
% Copyright 2012 The MathWorks, Inc.