No BSD License  

Highlights from
Rank revealing lu decomposition

from Rank revealing lu decomposition by Pawel Kowal
calculates rank revealing lu decomposition

null_lu(A)
function N = null_lu(A)
%  PURPOSE: returns a basis of the left null space of A
%
% -------------------------------------------------------------------------
%  USAGE: N = null_lu(A)
%  where: 
%         A             full real matrix
%         N             a basis of the left null space of A, N*A = 0
%
% -------------------------------------------------------------------------
%   COMMENTS:
%       Calculating null space using rank revealing lu decomposition is 
%       faster than using qr or svd decomposition but less accurate. 
%       If one requires very precise null space
%       or zero and nonzero singular values are not clearly separated, 
%       then more reliable algorithms should be used. 

% All rights reserved
% null_lu is available free for noncommercial academic use only.
% pawel.kowal@ibs.org.pl
% 08.2006.

[n,m]       = size(A);
[L,U,P,Q]   = rrlu_mex(A,0);

tol         = max([n,m])*norm(A,1)*eps;
Rank        = getRank(0,L,U,tol);
L1          = L(1:Rank,1:Rank);
L2          = L(Rank+1:end,1:Rank);
N           = [-L2/L1 eye(n-Rank)];
[dum,P]     = sort(P);
N           = N(:,P);

Contact us at files@mathworks.com