You are on page 1of 6

Ejercicio 10

>> a=[1,2,3,4,5;2,3,4,5,6;3,4,5,6,7;4,5,6,7,8]

a=

1 2 3 4 5

2 3 4 5 6

3 4 5 6 7

4 5 6 7 8

>> b=[8,7,6,5,4;7,6,5,4,3;6,5,4,3,2;5,4,3,2,1]

b=

8 7 6 5 4

7 6 5 4 3

6 5 4 3 2

5 4 3 2 1

>> c=[8,6,4,2,0;7,4,1,-2,-5;6,2,-2,-6,-10;5,0,-5,-10,-15]

c=

8 6 4 2 0

7 4 1 -2 -5

6 2 -2 -6 -10

5 0 -5 -10 -15

>> d=[1,2,3,4,5;1,4,9,16,25;2,4,6,8,10;1,8,27,64,125]
d=

1 2 3 4 5

1 4 9 16 25

2 4 6 8 10

1 8 27 64 125

>> e=[1,2,4,7,11;125,64,27,8,1;126,66,31,15,12;-124,-62,-23,-1,10]

e=

1 2 4 7 11

125 64 27 8 1

126 66 31 15 12

-124 -62 -23 -1 10

>> f=[0,3,6,9,12;0,1,3,6,10;0,4,8,12,16;15,10,5,0,-5]

f=

0 3 6 9 12

0 1 3 6 10

0 4 8 12 16

15 10 5 0 -5

A) >> a=[1,2,3,4,5;2,3,4,5,6;3,4,5,6,7;4,5,6,7,8]

a=
1 2 3 4 5

2 3 4 5 6

3 4 5 6 7

4 5 6 7 8

>> a(:,[1,3,5])=[]

a=

2 4

3 5

4 6

5 7

>> vic=a

vic =

2 4

3 5

4 6

5 7

B) >> b(:,[2,4])=[]

b=

8 6 4

7 5 3

6 4 2

5 3 1
>> filB=b

filB =

8 6 4

7 5 3

6 4 2

5 3 1

c)

>> c(:,[2,4])=[]

c=

8 4 0

7 1 -5

6 -2 -10

5 -5 -15

>> filasC=c

filasC =

8 4 0

7 1 -5

6 -2 -10

5 -5 -15

d)

>> d(:,[1])=[]
d=

2 3 4 5

4 9 16 25

4 6 8 10

8 27 64 125

>> comb=d

comb =

2 3 4 5

4 9 16 25

4 6 8 10

8 27 64 125

e)

>> e(:,[4,5])=[]

e=

1 2 4

125 64 27

126 66 31

-124 -62 -23


>> w=e

w=

1 2 4

125 64 27

126 66 31

-124 -62 -23

f) >> u=diag(f)

u=

(no supe como obtener el valor de la diagonal inversa)

You might also like