Tarea
Tarea
Tarea
ans =
'08-Dec-2023'
>> %Ejercicio 1
>> %Literal a
>> r=5
r =
>> radio=pi*r^2
radio =
78.5398
>> %Literal b
>> r=10
r =
10
>> radio_esfera=(4*pi)*r^2
radio_esfera =
1.2566e+03
>> %Literal c
>> r=2
r =
>> V=4/3*pi*r^3
V =
33.5103
>> %Ejercicio 2
>> %Literal a
>> arista=5
arista =
5
MATLAB Command Window Page 2
>> A= arista^2
A =
25
>> %literal b
>> arista=10
arista =
10
>> AS=6*arista^2
AS =
600
>> %literal c
>> arista=12
arista =
12
>> V=arista^3
V =
1728
>> %Ejercicio 3
>> g=6.673*10^-11;
>> mT=6*10^24;
>> m2=7.4*10^22;
>> r=3.9*10^8;
>> F=G*m1*m2/r^2
Unrecognized function or variable 'G'.
>> F=g*mT*m2/r^2
F =
1.9479e+20
>> %Ejericio 4
>> r=linspace(3.8*10^8, 4*10^8, 10)
r =
1.0e+08 *
>> F=g*(mT*m2)./r.^2
F =
1.0e+20 *
>> %Ejercicio 5
>> grados=[20, 45, 60, 75];
>> radianes=[grados*pi/180];
>> G_R=[grados',radianes']
G_R =
20.0000 0.3491
45.0000 0.7854
60.0000 1.0472
75.0000 1.3090
>> G_a_R=[grados',radianes']
G_a_R =
20.0000 0.3491
45.0000 0.7854
60.0000 1.0472
75.0000 1.3090
>> %Ejercicio 5
>> %Funciones trigonometricas
>> %Ejercicio 3.10
>> x=0:0.1:2*pi;
>> seno=sin(x);
>> coseno=cos(x);
>> tangente=tan(x);
>> Tabla=table(x',sin(x)',cos(x)',tan(x)','VariableNames',{'Angulo', 'Seno',
'Coseno','Tangente'})
Error using matlab.lang.makeUniqueStrings>validateExclStrOrElemToChk
First optional argument must be a string array, character vector, cell array of
character vectors, logical array, or
integer array.
>> Tabla=table(x',seno(x)',coseno(x)',tangente(x)','VariableNames',{'Angulo',
'Seno','Coseno','Tangente'})
Array indices must be positive integers or logical values.
>> Tabla=table(x',seno',coseno',tangente','VariableNames',{'Angulo',
'Seno','Coseno','Tangente'})
Tabla =
63×4 table
0 0 1 0
0.1 0.099833 0.995 0.10033
0.2 0.19867 0.98007 0.20271
0.3 0.29552 0.95534 0.30934
0.4 0.38942 0.92106 0.42279
: : : :
Tabla =
63×4 table
0 0 1 0
0.1 0.099833 0.995 0.10033
0.2 0.19867 0.98007 0.20271
0.3 0.29552 0.95534 0.30934
0.4 0.38942 0.92106 0.42279
0.5 0.47943 0.87758 0.5463
0.6 0.56464 0.82534 0.68414
0.7 0.64422 0.76484 0.84229
0.8 0.71736 0.69671 1.0296
0.9 0.78333 0.62161 1.2602
1 0.84147 0.5403 1.5574
1.1 0.89121 0.4536 1.9648
1.2 0.93204 0.36236 2.5722
1.3 0.96356 0.2675 3.6021
1.4 0.98545 0.16997 5.7979
1.5 0.99749 0.070737 14.101
1.6 0.99957 -0.0292 -34.233
MATLAB Command Window Page 5
Tabla =
63×4 table
0 0 1 0
0.1 0.099833 0.995 0.10033
0.2 0.19867 0.98007 0.20271
0.3 0.29552 0.95534 0.30934
0.4 0.38942 0.92106 0.42279
0.5 0.47943 0.87758 0.5463
0.6 0.56464 0.82534 0.68414
0.7 0.64422 0.76484 0.84229
0.8 0.71736 0.69671 1.0296
0.9 0.78333 0.62161 1.2602
1 0.84147 0.5403 1.5574
1.1 0.89121 0.4536 1.9648
1.2 0.93204 0.36236 2.5722
1.3 0.96356 0.2675 3.6021
1.4 0.98545 0.16997 5.7979
1.5 0.99749 0.070737 14.101
1.6 0.99957 -0.0292 -34.233
1.7 0.99166 -0.12884 -7.6966
1.8 0.97385 -0.2272 -4.2863
1.9 0.9463 -0.32329 -2.9271
2 0.9093 -0.41615 -2.185
2.1 0.86321 -0.50485 -1.7098
2.2 0.8085 -0.5885 -1.3738
2.3 0.74571 -0.66628 -1.1192
2.4 0.67546 -0.73739 -0.91601
2.5 0.59847 -0.80114 -0.74702
2.6 0.5155 -0.85689 -0.6016
2.7 0.42738 -0.90407 -0.47273
2.8 0.33499 -0.94222 -0.35553
2.9 0.23925 -0.97096 -0.24641
3 0.14112 -0.98999 -0.14255
3.1 0.041581 -0.99914 -0.041617
3.2 -0.058374 -0.99829 0.058474
3.3 -0.15775 -0.98748 0.15975
3.4 -0.25554 -0.9668 0.26432
3.5 -0.35078 -0.93646 0.37459
3.6 -0.44252 -0.89676 0.49347
3.7 -0.52984 -0.8481 0.62473
3.8 -0.61186 -0.79097 0.77356
3.9 -0.68777 -0.72593 0.94742
4 -0.7568 -0.65364 1.1578
4.1 -0.81828 -0.57482 1.4235
4.2 -0.87158 -0.49026 1.7778
4.3 -0.91617 -0.4008 2.2858
4.4 -0.9516 -0.30733 3.0963
4.5 -0.97753 -0.2108 4.6373
4.6 -0.99369 -0.11215 8.8602
4.7 -0.99992 -0.012389 80.713
4.8 -0.99616 0.087499 -11.385
4.9 -0.98245 0.18651 -5.2675
5 -0.95892 0.28366 -3.3805
5.1 -0.92581 0.37798 -2.4494
5.2 -0.88345 0.46852 -1.8856
5.3 -0.83227 0.55437 -1.5013
5.4 -0.77276 0.63469 -1.2175
MATLAB Command Window Page 7
x =
>> tabla==table(t',x','VariableNames',{'Tiempo','Desplazamiento'})
Unrecognized function or variable 'tabla'.
>> Tabla=table(t',x','VariableNames',{'Tiempo','Desplazamiento'})
Tabla =
11×2 table
Tiempo Desplazamiento
______ ______________
0 4
1 3.3013
2 1.4494
3 -0.90881
4 -2.9496
5 -3.96
6 -3.587
7 -1.961
8 0.35
9 2.5388
10 3.8407
>> %Ejercicio 6
>> Q=8000;
>> R=1.987;
>> K0=1200;
>> T=100:50:500;
>> T=100:50:500;
MATLAB Command Window Page 8
>> K=K0*exp(-Q./(R.*T))
K =
>> tabla=table(T',K','VariableNames',{'Temperatura','K'})
tabla =
9×2 table
Temperatura K
___________ __________
100 3.9242e-15
150 2.6438e-09
200 2.17e-06
250 0.00012162
300 0.0017812
350 0.012116
400 0.05103
450 0.15615
500 0.38203
>> %Ejercicio 7
>> x=10;
>> b=1:10;
>> r==log(x)./log(b)
ans =
0 0 0 0 0 0 0 0 0 0
>> r=log(x)./log(b)
r =
>> %Ejercicio 8
>> P0=100;
>> r=0.9;
>> t=10;
>> P=P0*exp(r*t)
P =
8.1031e+05
>> %Ejercicio 9
MATLAB Command Window Page 9
a =
15 3 22
3 8 5
14 3 82
>> b=[1;5;6]
b =
1
5
6
>> c=[12 18 5 2]
c =
12 18 5 2
>> d=a(:,3)
d =
22
5
82
>> e=[b,d]
e =
1 22
5 5
6 82
>> f=[b;d]
f =
1
5
6
22
5
82
>> g=[a;c(1:3)]
g =
15 3 22
3 8 5
MATLAB Command Window Page 10
14 3 82
12 18 5
>> h=[a(1,3),c(1,2),b(2,1)]
h =
22 18 5
>> %Ejercicio 10
>> b=0:1:10;
>> h=2:1:6;
>> [b,h]=meshgrid(b,h);
>> A=(1/2)*b.*h
A =
>> %Ejercicio 11
>> temperatura=100:100:100;
>> Presiones=100:100:100;
>> R=0.2870;
>> V=(R.*temperatura')./Presiones
V =
0.2870
>> temperatura=100:100:1000;
>> Presiones=100:100:1000;
>> R=0.2870;
>> V=(R.*temperatura')./Presiones
V =
>> %Ejercicio 12
>> a=magic(5)
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
>> %Literal a
>> b=a*2
b =
34 48 2 16 30
46 10 14 28 32
8 12 26 40 44
20 24 38 42 6
22 36 50 4 18
c =
d =
19 26 3 10 17
25 7 9 16 18
6 8 15 22 24
12 14 21 23 5
MATLAB Command Window Page 12
13 20 27 4 11
matriz =
17 24 1 8 15 34 48
2 16 30
23 5 7 14 16 46 10
14 28 32
4 6 13 20 22 8 12
26 40 44
10 12 19 21 3 20 24
38 42 6
11 18 25 2 9 22 36
50 4 18
1090 900 725 690 820 19 26
3 10 17
850 1075 815 720 765 25 7
9 16 18
700 840 1145 840 700 6 8
15 22 24
765 720 815 1075 850 12 14
21 23 5
820 690 725 900 1090 13 20
27 4 11