function aplus = pseudoinverse ( a )

%% PSEUDOINVERSE computes the pseudoinverse of a matrix.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    03 February 2009
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real A(M,N), the matrix.
%
%    Output, real APLUS(N,M), the pseudoinverse of A.
%
  [ u, s, v ] = svd ( a );

  splus = compute_splus ( s );

  aplus = v * splus * u';

  return
end
