% Example 3.20 svd
% K. Ming Leung, 04/24/03

clear all; format short;
A = [ 0.913 0.659
        0.780 0.563
        0.457 0.330 ];
[U, S, V] = svd(A),
dS = diag(S),
% approximate matrix A using only
% the first singular value and the corresponding
% left and right singular vectors:
B = S(1,1)*U(:,1)*(V(:,1).'),
% The original A:
A,