ode45 output
2 views (last 30 days)
Show older comments
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 Comments
Andrew Newell
on 10 Feb 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.
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!