help-octave
[Top][All Lists]

## Re: LU decomposition

 From: A S Hodel Subject: Re: LU decomposition Date: Tue, 11 Sep 2001 11:03:19 -0500

```What you're trying to do is numerically ill conditioned; e.g.,

A = [0 1; 1 0] has no LU decompostion without pivoting.
You may need to write your own routine to do the gaussian reduction.
```
That's not too difficult (but the algorithm is "stinky"). See Golub and van Loan's book
```Matrix Computations for details on implementation and pitfalls.

```
```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
-------------------------------------------------------------
```
```
--
--
```
A. S. Hodel 200 Broun Hall Dept. Elect. & Comp. Eng., Auburn Univ. AL 36849-5201
```http://www.eng.auburn.edu/~scotte   334 844 1854  Fax: -1809

-------------------------------------------------------------
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
-------------------------------------------------------------

```