0% found this document useful (0 votes)
53 views2 pages

LabMatlab Ejercicios Laboratorio de Matrices Resueltos PDF

The document shows MATLAB code that defines several matrices (a, b, c) and performs operations on them. It extracts elements, slices, and concatenates the matrices in various ways, storing the results in new variables (x1 through x8).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

LabMatlab Ejercicios Laboratorio de Matrices Resueltos PDF

The document shows MATLAB code that defines several matrices (a, b, c) and performs operations on them. It extracts elements, slices, and concatenates the matrices in various ways, storing the results in new variables (x1 through x8).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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