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
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