What did I do wrong here?
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos


u0 = 5000;
lambda = 0.03;
pm = 9000;
k = 100;
f = @(p) lambda*p*(1-p/pm)-k
pf = RK4(f,u0,10,100)

Respuestas (1)
Gifari Zulkarnaen
el 5 de Jul. de 2020
0 votos
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 comentarios
Walter Roberson
el 5 de Jul. de 2020
Right. Use
f = @(t,p) lambda.*.p.*(1-p./pm)-k
Zifeng Qiu
el 5 de Jul. de 2020
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!