FUNCTION REFERENCE
lu
LU factorization with partial pivoting.
LU factorization with partial pivoting.
Syntax
[L, U, P] = lu(A)Syntax
[L, U] = lu(A)Syntax
Y = lu(A)Syntax
[L, U, p] = lu(A, 'vector')Syntax
[L, U, P] = lu(A, 'matrix')P*A = L*U with L unit lower triangular. With two outputs L is the
permuted lower factor, so A = L*U. With one output Y holds U on and above
the diagonal and the multipliers of L below it. 'vector' returns the row
permutation as a row vector p, so A(p,:) = L*U. A may be rectangular.
Example
[L, U, P] = lu([1 2 3; 4 5 6; 7 8 10]) % U(1,:) = 7 8 10Differences from MATLAB: sparse input and other options are not
supported. Complex double input pivots by |re|+|im| as LAPACK does.
MatRust also accepts logical input.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.