Computes the solution of a linear equation, given its LU decomposition.
x = linalg_solvelu ( L , U , b ) x = linalg_solvelu ( L , U , b , verbose )
a n-by-n matrix of doubles, lower triangular.
a n-by-n matrix of doubles, upper triangular.
a n-by-1 matrix of doubles
a 1-by-1 matrix of boolean (default verbose = %f), set to %t to display intermediate messages
a n-by-1 matrix of doubles
Solve Ax=b with A=L*U and L lower triangular and U upper triangular. Effective algorithm with vectorization.
L=[ 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 ]; U=[ 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 ]; b=[5;9;12;14;15]; xe=[1;1;1;1;1] x=linalg_solvelu(L,U,b) // See what happens x=linalg_solvelu(L,U,b,%t) // See the algorithm edit linalg_solvelu | ![]() | ![]() |