Van Der Pol. Error. Not enough input arguments.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello.
I have just copy the program Van Der Pol resolution from mathworks.
This program:
function dy = vdp1000(t,y)
dy = zeros(2,1); % a column vector
dy(1) = y(2);
dy(2) = 1000*(1 - y(1)^2)*y(2) - y(1);
[T,Y] = ode15s(@vdp1000,[0 3000],[2 0]);
plot(T,Y(:,1),'-o')
when I run the program, appear the next error:
vdp1000
Error using vdp1000 (line 3)
Not enough input arguments.
The line 3 is: dy(1) = y(2);
what do I make wrong?
I would be very grateful to someone who helps me.
Best regards,
MJ
0 Kommentare
Antworten (1)
Walter Roberson
am 7 Apr. 2018
You need to split that code into two parts.
[T,Y] = ode15s(@vdp1000,[0 3000],[2 0]);
plot(T,Y(:,1),'-o')
should be in one file, and
function dy = vdp1000(t,y)
dy = zeros(2,1); % a column vector
dy(1) = y(2);
dy(2) = 1000*(1 - y(1)^2)*y(2) - y(1);
should be in vdp1000.
You would invoke the other file, not the vdp1000 file.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Desktop 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!