Creating vector in ODE Function to plot graphs
Mostrar comentarios más antiguos
Hi, i want to plot the acceleration over time but i dont know how i can create a vector for the acceleration dvdt and the time t. There are just single outputs for them when i run the code.
tRange = [0 120];
v0 = 6000;
[tSol,vSol] = ode45(@fallingbody,tRange,v0);
plot(tSol,vSol)
function dvdt = fallingbody(t,v)
D = 3.3e-5;
g = 3.72;
dvdt = g - D*v^2
%plot(t,dvdt)
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Assembly en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


