LU decomposition: Difference between revisions
Content added Content deleted
(LU composition of Matlab / Octave) |
(→{{header|Matlab / Octave}}: format fix; change output from lang to pre (they can't be used as input)) |
||
Line 1,096: | Line 1,096: | ||
=={{header| |
=={{header|MATLAB}} / {{header|Octave}}== |
||
LU decomposition is part of language |
LU decomposition is part of language |
||
<lang Matlab> |
<lang Matlab> A = [ |
||
⚫ | |||
1 3 5 |
1 3 5 |
||
2 4 7 |
2 4 7 |
||
Line 1,108: | Line 1,107: | ||
[L,U,P] = lu(A)</lang> |
[L,U,P] = lu(A)</lang> |
||
gives the output: |
gives the output: |
||
<pre> |
|||
<lang Matlab> L = |
|||
⚫ | |||
1.00000 0.00000 0.00000 |
1.00000 0.00000 0.00000 |
||
Line 1,125: | Line 1,125: | ||
1 0 0 |
1 0 0 |
||
0 0 1 |
0 0 1 |
||
⚫ | |||
⚫ | |||
2nd example: |
2nd example: |
||
<lang Matlab> A = [ |
<lang Matlab> A = [ |
||
Line 1,136: | Line 1,135: | ||
[L,U,P] = lu(A)</lang> |
[L,U,P] = lu(A)</lang> |
||
gives the output: |
gives the output: |
||
<pre> |
|||
<lang Matlab> L = |
|||
L = |
|||
1.00000 0.00000 0.00000 0.00000 |
1.00000 0.00000 0.00000 0.00000 |
||
Line 1,155: | Line 1,155: | ||
0 0 1 0 |
0 0 1 0 |
||
0 1 0 0 |
0 1 0 0 |
||
0 0 0 1 |
0 0 0 1 |
||
</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |