ode45 output
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
Andrew Newell
2012-2-10
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!