Error Message Using ODE45
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
The following code was copied directly from MatLab ODE45 documentation into MatLab script:
function dydt = vdp1(t,y)
%VDP1 Evaluate the van der Pol ODEs for mu = 1
% See also ODE113, ODE23, ODE45.
% Copyright 1984-2014 The MathWorks, Inc.
dydt = [y(2); (1-y(1)^2)*y(2)-y(1)];
[t,y] = ode45(@vdp1,[0 20],[2; 0]);
plot(t,y(:,1),'-o',t,y(:,2),'-o')
The error message received from RUN execution is:
>> vdp1
Not enough input arguments.
Error in vdp1 (line 7)
dydt = [y(2); (1-y(1)^2)*y(2)-y(1)];
Is there a solution or work around for this issue?
0 comentarios
Respuestas (4)
Walter Roberson
el 14 de Dic. de 2019
The part starting from
[t,y] = ode45(@vdp1,[0 20],[2; 0]);
plot(t,y(:,1),'-o',t,y(:,2),'-o')
Should be in a different file that is the one to be run.
0 comentarios
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!