about use function ode45
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Mischa Kim
2014 年 12 月 5 日
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 件のコメント
参考
カテゴリ
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!