help-octave
[Top][All Lists]

## LU decomposition

 From: SZABO Sandor Subject: LU decomposition Date: Tue, 11 Sep 2001 15:37:30 +0200

```Hello,

I want to obtain the LU decomposition of a matrix.
(That is A=L*U,  without P(!), NOT  P*A=L*U.)
I can do it with Mathematica and Maple, but how
could I obtain the SAME result?!
I use 2.1.34 Octave version.
>> A=[1 4 7; 2 5 8; 3 6 11]
A =

1        4        7
2        5        8
3        6       11
>> [L,U]=lu(A)
L =

0.33333  1.00000  0.00000
0.66667  0.50000  1.00000
1.00000  0.00000  0.00000

U =

1.0e+01  *

0.30000   0.60000   1.10000
0.00000   0.20000   0.33333
0.00000   0.00000  -0.10000

>> L*U
ans =

1        4        7
2        5        8
3        6       11

Here L is NOT lower triangular matrix!
The LU decomposition of A is the following

L=
1   0   0
2   1   0
3   2   1

U=
1   4   7
0   -3  -6
0   0   2

Thanks,
Sandor Szabo

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```