Error while using ode15i:Not enough input arguments.

3 ビュー (過去 30 日間)
nisha bhatt
nisha bhatt 2022 年 5 月 28 日
コメント済み: Walter Roberson 2022 年 5 月 28 日
I am facing problem running the follwoing code..It gives results when it was 8x1 differential equation problem..Now adding two more differential equations provides the following error
Error using TRYING_NEWF_rungekutta>tryingode (line 202)
Not enough input arguments.
Error in TRYING_NEWF_rungekutta>@(t,y,yp)tryingode(t,y,yp) (line 22)
[yo_new,ypo_new] = decic(@(t,y,yp)tryingode(t,y,yp),to,yo,[fixed_yo],ypo,[]);
Error in decic (line 66)
res = feval(odefun,t0,y0,yp0,varargin{:});

採用された回答

Walter Roberson
Walter Roberson 2022 年 5 月 28 日
In any current version of MATLAB, MATLAB is permitted to assume that scripts will not assign to any variable name that is also the name of a function. You assign to Idisc in the script PROP but MATLAB is permitted to assume that Idisc is still the function named Idisc and that you are invoking that function without any parameters.
The work-arounds are:
  • rename your variables to names that cannot possibly clash with any current function name or any function name that might possibly be in the MATLAB path of any user within the expected lifetime of your code; OR
  • assign something (anything) to those variables in your function before calling the script, so that MATLAB knows that they are variables; OR
  • make PROP into a function that returns a composite variable (such as a struct) that you reference in your code, such as
P = PROP();
P.Idisc...
  2 件のコメント
nisha bhatt
nisha bhatt 2022 年 5 月 28 日
I have rename Idisc into momentofinertia in PROP script but still facing the same issue..
Walter Roberson
Walter Roberson 2022 年 5 月 28 日
lt is a definite name clash as it is the formal name of the < function.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by