trying to solve an ode using ode45

1 Ansicht (letzte 30 Tage)
Anas Gharsa
Anas Gharsa am 25 Jan. 2022
Kommentiert: Anas Gharsa am 25 Jan. 2022
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 Kommentar
Ankit
Ankit am 25 Jan. 2022
Bearbeitet: Ankit am 25 Jan. 2022
this is because your y values are NaN

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ankit
Ankit am 25 Jan. 2022
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);

Weitere Antworten (0)

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by