How can I stop ode45
古いコメントを表示
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);
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!