I'm trying to use ODE15i to solve a very easy problem (y'=y with y(0)=1). since I will have more complicated relationships to deal with later. I'm not familiar with this coding language so my example can not run. I ran and there is an error saying no enough parameters is provided. How should I make it right?
That's my main code:
clearvars;
tspan=[0 1];
y0=1;
yp0=1;
options=odeset('AbsTol',1e-10);
[t,y] = ode15i(odefun_try,tspan,y0,yp0);
plot(t,y,'--blue'); title('real');
and function defined in another .m file named odefun_try.m:
function f = odefun_try(t,y,yp)
f = yp - y;
end

 채택된 답변

Torsten
Torsten 2024년 1월 7일
이동: Dyuman Joshi 2024년 1월 7일

0 개 추천

[t,y] = ode15i(@odefun_try,tspan,y0,yp0);
instead of
[t,y] = ode15i(odefun_try,tspan,y0,yp0);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

제품

태그

질문:

2024년 1월 7일

이동:

2024년 1월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by