trying to solve an ode using ode45

2 ビュー (過去 30 日間)
Anas Gharsa
Anas Gharsa 2022 年 1 月 25 日
コメント済み: Anas Gharsa 2022 年 1 月 25 日
I tried to solve an ode with the command ode45 and plot the result!!it works fine but it does not show the graph!!!
this is what i wrote
F = @(t,y)(y/t+1 + 5*((t+1)/(1+25*t^2)));
[t,y] = ode45 (F,[0,1],1);
plot(t,y);
  1 件のコメント
Ankit
Ankit 2022 年 1 月 25 日
編集済み: Ankit 2022 年 1 月 25 日
this is because your y values are NaN

サインインしてコメントする。

採用された回答

Ankit
Ankit 2022 年 1 月 25 日
you forgot to put bracket
F = @(t,y)(y/(t+1) + 5*((t+1)/(1+25*t^2)));
[t,y] = ode45 (F,[0 1],1);
plot(t,y);
  1 件のコメント
Anas Gharsa
Anas Gharsa 2022 年 1 月 25 日
thank you so much !!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by