Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

What did I do wrong here?

1 Ansicht (letzte 30 Tage)
Zifeng Qiu
Zifeng Qiu am 4 Jul. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
u0 = 5000;
lambda = 0.03;
pm = 9000;
k = 100;
f = @(p) lambda*p*(1-p/pm)-k
pf = RK4(f,u0,10,100)

Antworten (1)

Gifari Zulkarnaen
Gifari Zulkarnaen am 5 Jul. 2020
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 Kommentare
Walter Roberson
Walter Roberson am 5 Jul. 2020
Right. Use
f = @(t,p) lambda.*.p.*(1-p./pm)-k
Zifeng Qiu
Zifeng Qiu am 5 Jul. 2020
Thank you very much

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by