Error Message Using ODE45
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (4)
Walter Roberson
am 14 Dez. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!