u0=[vf1m(jj) 0]';
tspan=[0 13]';
Opt = odeset('Events', @myEvent);
[t,u]= ode45(@(t,u) ok(t,u,p2,m,maxu,maxT), tspan, u0,Opt);
function [value, isterminal, direction] = myEvent(t, u, minu)
value = u(1)<=minu
isterminal = 1;
direction = 0;
Not enough input arguments.
Error in myEvent (line 2)
value = u(1)<=minu
Error in odeevents (line 28)
eventValue = feval(eventFcn,t0,y0,eventArgs{:});
Error in ode45 (line 148)
odeevents(FcnHandlesUsed,odeFcn,t0,y0,options,varargin);
Error in skr (line 217)
[t,u]= ode45(@(t,u) ok(t,u,p2,m,maxu,maxT), tspan, u0,Opt);
1 Comment
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/513597-stop-ode45-when-y-is-less-than-a-value#comment_817005
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/513597-stop-ode45-when-y-is-less-than-a-value#comment_817005
Sign in to comment.