Escolar Documentos
Profissional Documentos
Cultura Documentos
NACIONAL PEDRO
RUIZ GALLO
Facultad de Ciencias Fsicas y
Matemticas
EJERCICIOS EN MATLAB
Presentado por:
MIO CUEVA
PARDO SILVA
RIOS IPARRAGUIRRE
>> diary('01miocueva.txt')
>> diary('02pardosilva.txt')
>> diary('03riosiparraguirre.txt')
>> %PROBLEMAS PROPUESTOS
>>PARTE 1
>>??? Undefined function or method 'PARTE' for input arguments of type 'char'.
>>
>> ejercicio 1a
??? Undefined function or method 'ejercicio' for input arguments of type 'char'.
>> (35.7*64-(7^3))/(45+(5*(4^2)))
ans =
15.5344
>>
>>
>> ejercicio 1b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> (1.25*7*(6^2))+((3^7)/((9^3)-652))
ans =
343.4026
>>
>>
>>
>> ejercicio 2a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> ((2+7)^3)+((273^(2/3))/2)+((55^2)/3)
ans =
1.7584e+003
>>
>>
>> ejercicio 2b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> (2^3)+(7^3)+((273^3)/2)+(55^(2/3))
ans =
1.0174e+007
>>
>>
>> ejercicio 3a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> (((3^7)*(log(76)))/((7^3)+546))+(910^(1/3))
ans =
20.3444
>>
>>
>>
>> ejercicio 3b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> 43*(((250^(1/4))+23)^2)/(exp(45-(3^3)))
ans =
4.7658e-004
>>
>>
>>
>> ejercicio 4a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
((cos((5/6)*pi))^2)*sin(((7/8)*pi)^2)+((tan((pi/6)*log(8)))/sqrt(7))
ans =
1.4395
>> ejercicio 4b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> cos(((5/6)*pi)^2)*(sin((7/8)*pi))^2+((tan((pi/6)*log(8)))/(7*2.5))
ans =
0.2325
>>
>>
>>
>> ejercicio 5a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> x=13.5
x=
13.5000
>> x^3+5*(x^2)-(26.7*x)-52
ans =
2.9592e+003
>>
>>
>> ejercicio 5b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> x
x=
13.5000
>> (sqrt(14*(x^3)))/exp(3*x)
ans =
4.7823e-016
>>
>>
>> ejercicio 5c
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> x
x=
13.5000
>> log(abs((x^2)-(x^3)))
ans =
7.7311
>>
>>
>> ejercicio 6a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
x=
9.6000
z=
8.1000
>> x*(z^2)-(((2*z)/(3*x))^(3/5))
ans =
629.1479
>>
>>
>> ejercicio 6b
??? Undefined function or method ' ejercicio ' for input arguments of type
'char'.
>> x,z
x=
9.6000
z=
8.1000
>> (443*z/2*(x^3))+(exp(-x*z)/(x+z))
ans =
1.5873e+006
>>
>>
>> ejercicio 7a
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
15.6200
b=
-7.0800
c=
62.5000
d=
-86.5448
>> a+(a*b/c)*(((a+d)^2)/sqrt(abs(a*b)))
ans =
-830.7755
>>
>>
>>
>>
>> ejercicio 7b
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
>> (d*exp(d/2))+(((a*d+c*d)/((20/a)+(30/b)))/(a+b+c+d))
ans =
-147.4700
>>
>>
>> ejercicio 8
??? Undefined function or method 'ejercicio' for input arguments of type
'char'.
v=
350
r=
9.3776
>> r
r=
9.3776
>> area=4*pi*(r^2)
area =
1.1051e+003
>>
>> area=4*pi*(r^2)
area =
1.1051e+003
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ejercicio 9a
??? Undefined function or method ' ejercicio ' for input arguments of type 'char'.
>> x=(5/24)*pi
x=
0.6545
>> lado1=sin(2*x)
lado1 =
0.9659
>> lado2=2*sin(x)*cos(x)
lado2 =
0.9659
>>
>>
>>
>>
>>
>>
>>
>> ejercicio 9b
??? Undefined function or method ' ejercicio ' for input arguments of type 'char'.
>> x
x=
0.6545
>> lado1=cos(x/2)
lado1 =
0.9469
>> lado2=sqrt(1+cos(x)/2)
lado2 =
1.1818
>> lado2=sqrt((1+cos(x))/2)
lado2 =
0.9469
>>
>>
'char'.
>> x=(3/17)*pi
x=
0.5544
>> lado1=tan(2*x)
lado1 =
2.0083
>> lado2=(2*tan(x))/(1-(tan(x))^2)
lado2 =
2.0083
>>
>>
>>
>>
>>
>> ejercicio 10b
'char'.
>> x
x=
0.5544
>> lado1=tan(x/2)
lado1 =
0.2845
>> lado2=sqrt((1-cos(x))/(1+cos(x)))
lado2 =
0.2845
>>
>>
>>
>>
>> ejercicio 11b
'char'
alfa =
1.7453
beta =
0.4488
>> lado1=cos(alfa)-cos(beta)
lado1 =
-1.0746
>> lado2=2*sin(0.5*(alfa+beta))*sin(0.5*(beta-alfa))
lado2 =
-1.0746
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ejercicio 12a
'char'.
a=
11
c=
21
b=
17.8885
>>
>>
>>
>>
>>
>> ejercicio 12b
'char'.
>> a,b,c
a=
11
b=
17.8885
c=
21
>> alfa=acos(((a^2)+(b^2)-(c^2))/(2*a*b))
alfa =
1.5708
>>
>>
>> ejercicio 13a
'char'.
a=
18
b=
35
b=
39.3573
>>
>>
>>
>>
>>
>>
>> ejercicio 13b
'char'.
>> a,b,c
a=
18
b=
39.3573
c=
21
>> alfa=acos(((a^2)+(b^2)-(c^2))/(2*a*b))
alfa =
0 + 0.1460i
>>
>>
>> ejercicio 14
'char'.
A=
B=
C=
-6
X=
Y=
-3
>> d=(abs((A*X)+(B*Y)+C))/(sqrt((A^2)+(B^2)))
d=
2.5725
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> PARTE 2
??? Undefined function or method 'PARTE' for input arguments of type 'char'.
>>
>>
>> EJERCICIO 1
'char'.
v=
>> EJERCICIO 2
'char'.
>> w=[55;14;log(51);987;0;5*sin(2.5*pi)]
w=
55.0000
14.0000
3.9318
987.0000
5.0000
>> ejercicio 3
'char'.
>> v1=1:2:33
v1 =
Columns 1 through 12
1 3 5 7 9 11 13 15 17 19 21 23
Columns 13 through 17
25 27 29 31 33
>>
>>
>> ejercicio 4
'char'.
>> V2=[15:-5:-25]
V2 =
'char'.
>> v=linspace(7,40,15)
v=
Columns 1 through 7
Columns 8 through 14
Column 15
40.0000
>>
>>
>>
>>
>>
>>
>>
>>
>> ejercicio 6
'char'.
>> v=linspace(-1,-15,12)
v=
Columns 1 through 7
Columns 8 through 12
>>
>>
>>
>>
>>
>>
>> ejercicio 7
'char'.
>> Aprimero=4:3:49
Aprimero =
Columns 1 through 12
4 7 10 13 16 19 22 25 28 31 34 37
Columns 13 through 16
40 43 46 49
>> Asegundo(1,:)=[4,7,10,13,39,42,45,48]
Asegundo =
4 7 10 13 39 42 45 48
>>
>>
>>
>> ejercicio 8
??? Undefined function or method 'ejercicio' for input arguments of type 'char'.
>> v1=1:3:25
v1 =
1 4 7 10 13 16 19 22 25
>> v2=72:-6:24
v2 =
72 66 60 54 48 42 36 30 24
>> v3=linspace(0,1,9)
v3 =
>> A=zeros(3,9)
A=
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
>> A(1,:)=v1,A(2,:)=v2
A=
1 4 7 10 13 16 19 22 25
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
A=
1 4 7 10 13 16 19 22 25
72 66 60 54 48 42 36 30 24
0 0 0 0 0 0 0 0 0
>> A(3,:)=v,A(1,:)=v1,A(2,:)=v2
>> A(1,:)=v1,A(2,:)=v2,A(3,:)=v
A=
1 4 7 10 13 16 19 22 25
72 66 60 54 48 42 36 30 24
0 0 0 0 0 0 0 0 0
A=
1 4 7 10 13 16 19 22 25
72 66 60 54 48 42 36 30 24
0 0 0 0 0 0 0 0 0
A=
1 4 7 10 13 16 19 22 25
72 66 60 54 48 42 36 30 24
0 0 0 0 0 0 0 0 0
A=
1 4 7 10 13 16 19 22 25
72 66 60 54 48 42 36 30 24
0 0 0 0 0 0 0 0 0
A=
>>
>>
>>
>> ejercicio 9
'char'.
P=
6 43 2 11 87
12 6 34 0 5
34 18 7 41 9
>> ejercicio 9.a
'char'.
>> Va=[12,6,34,0,5]
Va =
12 6 34 0 5
>>
>>
>> ejercicio 9b
??? Undefined function or method ' ejercicio ' for input arguments of type
'char'.
Vb =
11 0 41
>>
>>
>>
>>
>> ejercicio 9c
??? Undefined function or method ' ejercicio ' for input arguments of type
'char'.
>> Vc=[6,43,2,11,87,12,6,34,0,5]
Vc =
6 43 2 11 87 12 6 34 0 5
>>
>>
>>
>>
>> ejercicio 9d
??? Undefined function or method ' ejercicio ' for input arguments of type
'char'.
>> Vd=[43,6,18,87,5,9]
Vd =
43 6 18 87 5 9
>>
>>
>>
>>
>> ejercicio 10
??? Undefined function or method ' ejercicio ' for input arguments of type
'char'.
C=
2 4 6 8 10
3 6 9 12 15
7 14 21 28 35
>>
>>
'char'.
>> ua=[6;9;21]
ua =
21
>>
>>
>>
>>
>> ejercicio 10b
'char'.
>> ub=[3;6;9;12;15]
ub =
12
15
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
'char'.
>> uc=[2;3;7;6;9;21;10;15;35]
uc =
21
10
15
35
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
'char'.
>> ud=[2;4;6;8;10;3;6;9;12;15]
ud =
10
12
15
'char'.
>> A=zeros(4,7)
A=
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
'char'.
>> U=[21,18,15,12,9,6,3,5,10,9,25,7,14,3,35]
U=
Columns 1 through 12
21 18 15 12 9 6 3 5 10 9 25 7
Columns 13 through 15
14 3 35
'char'.
>> A1=zeros(2,5)
A1 =
0 0 0 0 0
0 0 0 0 0
>>
>>
>>
>>
>> ejercicio 12b
'char'.
>> A2=eye(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