How can I stop ode45
Afficher commentaires plus anciens
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);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!