0% found this document useful (0 votes)
16 views

Matlabcap 2

Uploaded by

hugo ae
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)
16 views

Matlabcap 2

Uploaded by

hugo ae
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/ 11

Problema 1

>> yr=[6 8*3 81 exp(2.5) sqrt(65) sin(pi/3)]

yr =

6.0000 24.0000 81.0000 12.1825 8.0623 0.8660

Problema 3
>> hugo=[0:3:42]

hugo =

0 3 6 9 12 15 18 21 24 27 30 33 36 39 42

Problema 5
hugo=linspace(5,61,16)

hugo =

Columns 1 through 12

5.0000 8.7333 12.4667 16.2000 19.9333 23.6667 27.4000 31.1333 34.8667 38.6000
42.3333 46.0667

Columns 13 through 16

49.8000 53.5333 57.2667 61.0000

Problema 7
>> same=[4:4:44]
same =

4 8 12 16 20 24 28 32 36 40 44

Problema 9

>> B=[0,4,8,12,16,20,24,28;69,68,67,66,65,64,63,62;1.4,1.1,0.8,0.5,0.2,-0.1,-0.4,-0.7]

B=

0 4.0000 8.0000 12.0000 16.0000 20.0000 24.0000 28.0000

69.0000 68.0000 67.0000 66.0000 65.0000 64.0000 63.0000 62.0000

1.4000 1.1000 0.8000 0.5000 0.2000 -0.1000 -0.4000 -0.7000

Problema 11

>> a=[2 -1 0 6]

a=

2 -1 0 6

>> b=[-5 20 12 -3]

b=

-5 20 12 -3

>> c=[10 7 -2 1]

c=
10 7 -2 1

A)
>> R=[a;b;c]

R=

2 -1 0 6

-5 20 12 -3

10 7 -2 1

B)
>> H=R'

H=

2 -5 10

-1 20 7

0 12 -2

6 -3 1

Problema 13

A) v=[2 7 -3 5 0 14 -1 10 -6 8]

v=

2 7 -3 5 0 14 -1 10 -6 8

>> a=v(3:6)
a=

-3 5 0 14
B) >> b=v([2 4:7 10])

b=

7 5 0 14 -1 8
C) >> c=v([9 3 1 10])

c=

-6 -3 2 8
D) >> d=[v([1 3 5]);v([2 4 6]);v([3 6 9])]

d=

2 -3 0

7 5 14
-3 14 -6
Problema 15

>> B=[15 12 9 6 3; 2 4 6 8 10; 6 12 18 24 30]

B=

15 12 9 6 3

2 4 6 8 10

6 12 18 24 30

A)
>> h=B(:,2)

h=

12

12

>> d=B(:,4)

d=

24

>> ua=[h;d]

ua =
12

12

24
B)
j=B(3,:)

j=

6 12 18 24 30

>> ub=j'

ub =

12

18

24

30

C)
x=B(:,2)

x=

12
4

12

>> y=B(:,4)

y=

24

>> z=B(:,5)

z=

10

30
xx=x'

xx =

12 4 12

>> yy=y'

yy =

6 8 24
>> zz=z'

zz =

3 10 30
uc=[xx yy zz]

uc =

12 4 12 6 8 24 3 10 30
D)
>> p=B(:,1)

p=

15

>> o=B(1,:)

o=

15 12 9 6 3

>> pp=p'

pp =
15 2 6

>> ud=[pp o]

ud =

15 2 6 15 12 9 6 3

Problema 17
>> M=[6 9 12 15 18 21; 4 4 4 4 4 4; 2 1 0 -1 -2 -3; -6 -4 -2 0 2 4]

M=

6 9 12 15 18 21

4 4 4 4 4 4

2 1 0 -1 -2 -3

-6 -4 -2 0 2 4

A)
>> A=M([1,3],[2,4])

A=

9 15

1 -1

B)
>> B=M(:,[1,4:6])

B=
6 15 18 21

4 4 4 4

2 -1 -2 -3

-6 0 2 4

C)
>> C=M([2,3],:)

C=

4 4 4 4 4 4
2 1 0 -1 -2 -3

Problema 19

>> A=eye(6)

A=

1 0 0 0 0 0

0 1 0 0 0 0

0 0 1 0 0 0

0 0 0 1 0 0

0 0 0 0 1 0

0 0 0 0 0 1

>> A(1:3,4:6)=3
A=

1 0 0 3 3 3

0 1 0 3 3 3

0 0 1 3 3 3

0 0 0 1 0 0

0 0 0 0 1 0

0 0 0 0 0 1

>> A(5:6,1:4)=2

A=

1 0 0 3 3 3

0 1 0 3 3 3

0 0 1 3 3 3

0 0 0 1 0 0

2 2 2 2 1 0

2 2 2 2 0 1

You might also like