You are on page 1of 2

MATLAB Command Window Page 1

>> %Practica 1%
>> a = [12 17 3 6]

a =

12 17 3 6

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

b =

5 8 3
1 2 3
2 4 6

>> c = [22;17;4]

c =

22
17
4

>> %Problema 1%
>> x1 = a(1,2)

x1 =

17

>> x2 = b(:,3)

x2 =

3
3
6

>> x3 = b(3,:)

x3 =

2 4 6

>> x4 = diag(b)

x4 =

5
2
6

>> x5 = [a(1,1:3);b]

x5 =
MATLAB Command Window Page 2

12 17 3
5 8 3
1 2 3
2 4 6

>> x6 = [c,b;a]

x6 =

22 5 8 3
17 1 2 3
4 2 4 6
12 17 3 6

>> x7 = b(8)

x7 =

>> x8 = [5;8;3;1;2;3;2;4;6]

x8 =

5
8
3
1
2
3
2
4
6

>>

You might also like