Function of ODE can not be executed well.
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
When I call and execute this function,I get an error.
function dy = myODE(~,y)
dy(1) = y(2);
dy(2) = y(1)*y(2)-2;
end
%code start
[t,y] = ode23(@vdp1,[0 20],[2; 0]);
%code end
Antworten (1)
James Tursa
am 26 Jun. 2017
Make sure the derivative function returns a column vector. E.g.,
function dy = myODE(~,y)
dy = zeros(2,1); % <-- column vector
dy(1) = y(2);
dy(2) = y(1)*y(2)-2;
end
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!