Funzioni MATLAB: alcune
funzioni fondamentali
» help lu
LU LU factorization.
[L,U] = LU(X) stores a upper triangular matrix in U
and a "psychologically lower triangular matrix" (i.e.
a product of lower triangular and permutation matrices)
in L, so that X = L*U. X must be square.
[L,U,P] = LU(X) returns lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that P*X = L*U .
LU(X), with one output argument, returns the output from LINPACK'S ZGEFA routine……….…………..
Esempi
:
» A
A =
2 3 2
4 2 1
3 3 3
» [L,U,P] = lu(A)
L = 1.0000 0 0
0.5000 1.0000 0
0.7500 0.7500 1.0000
U = 4.0000 2.0000 1.0000
0 2.0000 1.5000
0 0 1.1250
P = 0 1 0
1 0 0
0 0 1
» P1 = P*A; P2 = L*U;
» P1 -P2
ans = 0 0
0
0 0 0
0 0 0
»
» lu(A)
ans = 4.0000 2.0000 1.0000
-0.5000 2.0000 1.5000
-0.7500 -0.7500 1.1250
Alba C. Simoncelli | - MATLAB (nov. 2002) - pag.18 | Indice | Pag. Prec. | Pag. Seg. |