about use function ode45
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have written small program about ode45 my program is function z= func(t,y) z=t./y; ode45(f,[0 2],1)
and it did not run.
0 Commenti
Risposte (1)
Mischa Kim
il 5 Dic 2014
Mary, use
function my_ode()
[T,Z] = ode45(@func,[0 2],1); % use correct name of ODE function
plot(T,Z)
end
function z = func(t,y)
z = t./y;
end
Copy-paste the code into a MATLAB function window and safe as my_ode.m.
0 Commenti
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!