function ShowSVD()
% The SVD:
% Suppose A is mxn and that m>=n. There exists an mxm orthogonal matrix
% U and an nxn orthogonal matrix V so that U'*A*V = S is mxn and diagonal.
A = randn(5,3);
format short
clc
disp('The svd...')
A = A
[U,S,V] = svd(A)
pause
% The thin SVD:
% Suppose A is mxn and that m>=n. There exists an mxn matrix U with
% orthonormal columns and an nxn orthogonal matrix V so that
% U'*A*V = S is nxn and diagonal.
clc
A = A
disp('The thin svd...')
[U,S,V] = svd(A,0)
pause

clc
disp('The condition is the ratio of big to little singular value...')
m = 5;
n = 3;
kappa = 1000000;
A = gallery('randsvd', [m,n], kappa);
[U,S,V] = svd(A);
format long
fprintf('\nThe singular values...\n\n')
disp(diag(S))
fprintf('\nA*V(:n) = S(n,n)*U(:,n) = \n\n')
fprintf('%20.15f\n',A*V(:,n))