Why am I getting an error on this?

2 visualizaciones (últimos 30 días)
Ali Almakhmari
Ali Almakhmari el 14 de Dic. de 2022
Editada: Torsten el 14 de Dic. de 2022
Why am I getting an error that says "Not enough input arguments."
function dydx = funct(x, y, z)
a = 1;
b = 2;
c = 3;
dydx = a*y + b*z + c*x;
end
y0 = 1;
z0 = 2;
[x, y] = ode45(@funct, [0, 10], [y0, z0]);
plot(x, y);
  2 comentarios
Bora Eryilmaz
Bora Eryilmaz el 14 de Dic. de 2022
func() takes 3 scalar arguments (x, y, z), but you are passing a single vector argument ([y0, z0], etc.) to it.
Torsten
Torsten el 14 de Dic. de 2022
Editada: Torsten el 14 de Dic. de 2022
If you want to solve for two unknown functions (y and z), you need two differential equations, not only one.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by