Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What did I do wrong here?

1 回表示 (過去 30 日間)
Zifeng Qiu
Zifeng Qiu 2020 年 7 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
u0 = 5000;
lambda = 0.03;
pm = 9000;
k = 100;
f = @(p) lambda*p*(1-p/pm)-k
pf = RK4(f,u0,10,100)

回答 (1 件)

Gifari Zulkarnaen
Gifari Zulkarnaen 2020 年 7 月 5 日
In your function RK4 line 8 to 11, you have two inputs for f function while the f function has only one input value, thus "too many input arguments" error occured.
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 5 日
Right. Use
f = @(t,p) lambda.*.p.*(1-p./pm)-k
Zifeng Qiu
Zifeng Qiu 2020 年 7 月 5 日
Thank you very much

Community Treasure Hunt

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

Start Hunting!

Translated by