ode45 varargin - additional arguments after options
古いコメントを表示
Hi.
I'm looking at some code which calls ode45 using the following code:
[t_intermediate,x_intermediate] = ode45(system,[t0, t0+T], x0, options, u);
wheer the function system is defined as
function y = system(t, x, u, T)
y = x+u;
end
I am confused about the additional last argument 'u' of the call to ode45, and how this feeds into the solver. The documentation doesnt list any arguments after options, but opening the code I can see it accepts additional arguments through varargin, but I cant find any information about how 'u' would fit into this. Within the ode45 code, It looks like the varargin are processed in the function "odearguments", but there is no documentation on this function either.
In this example, 'u' is a control input into the system.
Thanks for the help in advance!
4 件のコメント
Torsten
2019 年 6 月 28 日
[t_intermediate,x_intermediate] = ode45(@(t,x)system(t,x,u,T),[t0, t0+T], x0, options);
Nshine
2019 年 6 月 28 日
Walter Roberson
2019 年 6 月 28 日
That code would have failed.
ode45(system,....)
would have called system with no arguments and expected it to return a function handle. The call would fail due to not enough inputs.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!