Está en la página 1de 9

1) parte a

-->A=[7 2 -3; 2 5 -3; 1 -1 -6]


A =

7.

2. - 3.

2.

5. - 3.

1. - 1. - 6.

-->b=[-12;-20;-26]
b =

- 12.
- 20.
- 26.

-->[L,U,E]=lu(A)
E =

1.

0.

0.

0.

1.

0.

0.

0.

1.

U =

7.

2.

- 3.

0.

4.4285714 - 2.1428571

0.

0.

- 6.1935484

L =

1.

0.

0.

0.2857143

1.

0.

0.1428571 - 0.2903226

-->c=sparse(A)
c =

3,

3) sparse matrix

1,

1)

7.

1,

2)

2.

1,

3)

- 3.

2,

1)

2.

2,

2)

5.

2,

3)

- 3.

3,

1)

1.

3,

2)

- 1.

3,

3)

- 6.

-->x=lusolve(c,b)
x =

0.71875
- 1.46875

1.

4.6979167

Parte b
-->A=[7 2 -3; 2 5 -3; 1 -1 -6]
A =

7.

2. - 3.

2.

5. - 3.

1. - 1. - 6.

-->b=[12;18;-6]
b =

12.
18.
- 6.

-->[L,U,E]=lu(A)
E =

1.

0.

0.

0.

1.

0.

0.

0.

1.

U =

7.

2.

- 3.

0.

4.4285714 - 2.1428571

0.

0.

- 6.1935484

L =

1.

0.

0.

0.2857143

1.

0.

0.1428571 - 0.2903226

-->c=sparse(A)
c =

3,

3) sparse matrix

1,

1)

7.

1,

2)

2.

1,

3)

- 3.

2,

1)

2.

2,

2)

5.

2,

3)

- 3.

3,

1)

1.

3,

2)

- 1.

3,

3)

- 6.

-->x=lusolve(c,b)
x =

1.

0.9375
3.5625
0.5625

2) parte a:
-->A=[1 7 -4; 4 -4 9; 12 -1 3]
A =

1.

7. - 4.

4. - 4.
12. - 1.

9.
3.

-->b=[-51; 62; 8]
b =

- 51.
62.
8.

-->[L,U,E]=lu(A)
E =

0.

0.

1.

1.

0.

0.

0.

1.

0.

U =

12. - 1.

3.

0.

7.0833333 - 4.25

0.

0.

5.8

L =

1.

0.

0.

0.0833333

1.

0.

0.3333333 - 0.5176471

-->c=sparse(A)
c =

3,

3) sparse matrix

1,

1)

1.

1,

2)

7.

1,

3)

- 4.

2,

1)

4.

2,

2)

- 4.

2,

3)

9.

3,

1)

12.

3,

2)

- 1.

3,

3)

3.

-->x=lusolve(c,b)

1.

x =

- 1.0649087
- 3.9229209
5.6186613

Parte b:
-->A=[1 7 -4; 4 -4 9; 12 -1 3]
A =

1.

7. - 4.

4. - 4.
12. - 1.

9.
3.

-->b=[12;18;-6]
b =

12.
18.
- 6.

-->[L,U,E]=lu(A)
E =

0.

0.

1.

1.

0.

0.

0.

1.

0.

U =

12. - 1.

3.

0.

7.0833333 - 4.25

0.

0.

5.8

L =

1.

0.

0.

0.0833333

1.

0.

0.3333333 - 0.5176471

-->c=sparse(A)
c =

3,

3) sparse matrix

1,

1)

1.

1,

2)

7.

1,

3)

- 4.

2,

1)

4.

2,

2)

- 4.

2,

3)

9.

3,

1)

12.

3,

2)

- 1.

3,

3)

3.

1.

-->x=lusolve(c,b)
x =

- 1.2657201
4.5030426
4.5638945