from UL factorization by Robert Piche
[U,L]=ul(A) returns a permuted unit upper triangular matrix U and a lower triangular matrix L such t

[u,l]=ul(A)
function [u,l]=ul(A)
%UL     UL factorization of a matrix.
% [U,L]=ul(A) returns a permuted unit upper triangular matrix U and a
% lower triangular matrix L such that A = U*L.

% Author: Robert Piche, Tampere University of Technology (2008)

[u,l]=lu(A(end:-1:1,end:-1:1));
u=u(end:-1:1,end:-1:1);
l=l(end:-1:1,end:-1:1);

Contact us at files@mathworks.com