%% Smallest Nonzero Singular Values
% Create a sparse 100-by-100 Neumann matrix.

C = gallery('neumann',100);

%
% Compute the ten smallest singular values.

ss = svds(C,10,'smallest')

%
% Compute the 10 smallest nonzero singular values. Since the matrix has a singular value that is equal to zero, the 'smallestnz' option omits it.

snz = svds(C,10,'smallestnz')

% Copyright 2012 The MathWorks, Inc.