How can I stop ode45
Mostrar comentarios más antiguos
Hi, how can I stop ode45 when the function is on the lowest point:
I have tried that.
options = odeset('Events', @deep);
[t, u] = ode45(@bet, [0 80], [0 0 L], options)
function [val, term, dir] x= deep (L)
[t, u]=ode45(@bet, [0 80], [0 0 L]);
x = max(u(:,1));
term = 1;
dir = -1;
But i got an error and for me is not sure why:
Error: File: deep.m Line: 1 Column: 27
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To
construct matrices, use brackets instead of parentheses.
Error in odeevents (line 28)
eventValue = feval(eventFcn,t0,y0,eventArgs{:});
Error in ode45 (line 148)
odeevents(FcnHandlesUsed,odeFcn,t0,y0,options,varargin);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!