Matlab - pasar a funciones anonimas

 
Vista:
sin imagen de perfil
Val: 20
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

pasar a funciones anonimas

Publicado por Julian Camilo (11 intervenciones) el 08/03/2019 06:38:43
buanas noches como puedo relacionar este codigo a las funciones anonimas y ademas haciendo ajuste de curvas. en la gráfica
gracias.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
clc,clear
disp('Calcular la alturaen un tiempo dado de un objeto en TIRO PARABOLICO')
Vi = input('inserte velocidad inicial del objeto (en m/s):');
angulo = input ('ingrese el angulo(en grados) con el cual fue disparado: ');
Yi = input('ingrese la altura(en metros) desde la cual es disparado el objeto: ');
tiempo = input('ingrese el tiempo (en segundos) en el cual desea saber a que altura se encuentra e objeto con respecto al suelo: ');
g = 9.8;
syms t
altura = Yi+(Vi*cos(angulo))*t+((Vi*sin(angulo))*t-((g/2)*t^2));
v = diff(altura,t);
a = diff(v,t);
x = 0;
while x<=tiempo
altura = Yi+(Vi*cos(angulo))*x+((Vi*sin(angulo))*x -((g/2)*x^2));
ax1 = subplot(3,1,1);
plot (x,altura,'b--.')
axis([0 tiempo 0 Yi])
drawnow;
pause(0.01);
title('POSICION');
    xlabel('tiempo (s)');
    ylabel('altura (m)');
hold on
 
velocidad=Vi*cos(angulo)+(Vi*sin(angulo) -(g*x));
ax2 = subplot(3,1,2);
plot (x,velocidad,'g--.')
axis([0 tiempo -100 0])
drawnow;
pause(0.01);
title('VELOCIDAD');
    xlabel('tiempo (s)');
    ylabel('velocidad (m/s)');
hold on
 
aceleracion=-g;
ax3 = subplot(3,1,3);
plot (x,aceleracion,'r--.')
axis([0 tiempo -20 0])
drawnow;
pause(0.01);
title('ACELERACIÓN');
    xlabel('tiempo (s)');
    ylabel('velocidad (m/s)');
hold on
x = x+0.1;
end
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder