How can i pull a corresponding y value for t=0.5, the matlab script below will out a list of values for y and t.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
mat lab
am 5 Dez. 2017
Beantwortet: Star Strider
am 5 Dez. 2017
odel = @(t,y)t + y + (t*y)
[t,y] = ode45(odel,[0:0.03:1],0.5)
plot(t,y,'linewidth',2)
xlabel('t'), ylabel('y'),grid on
title('Solution to the ODE dy/dt = t + y + (t*y)')
0 Kommentare
Akzeptierte Antwort
Star Strider
am 5 Dez. 2017
Easiest is to use the interp1 function:
y_t_05 = interp1(t, y, 0.5)
y_t_05 =
1.093740231070597
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!