ode solver store solution
13 次查看(过去 30 天)
显示 更早的评论
Hello im using this code calling it from main:
function Heat
[t,T]=ode15s(@dT_dt,[0,timespan],InitialTemp,options);
options = odeset('Jacobian',A);
return
function DT = dT_dt(t,T)
DT = A*T +b ;
return
i cant figure out how to store (t,T) in an array for using it somewhere else. Regards
0 个评论
回答(1 个)
Jan
2012-2-24
You can export t and T as output:
function [t, T] = Heat
...
Then your function is called as:
[t, T] = Heat;
But I think there are bugs in your program: The variable A is neither defined inside the function Heat not inside DT. Do you have a function called "A"? Are you sure that you want to call odeset after the integration and not before?
另请参阅
类别
在 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!