an example of using ode15i
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on App Building in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!