ode45 output
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I'm having trouble getting a list of values from my function.
function dT=odefun(t,T)
global T1 ...etc
... etc
T2=T1*((P2/P1)^n_ex);
dT=zeros(3,1);
dT(1)=...etc
T1=T2;
How can I get ode45 to return a list of all calculated values for T1, as for dT(3,1) and not just the last value?
Thank you
2 commentaires
Andrew Newell
le 10 Fév 2012
I strongly suspect that you have written odefun incorrectly. You are using a global variable to make each evaluation dependent on the previous one, which is not good practice. If you could add a description of your problem to your question, we might be able to help you sort it out.
Réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!