Hello everybody! I seem to be very unlucky, I can not find any solution to my problem – I have:
Error using chu2 (line 9)Not enough input arguments.
Here is my code:
function dy = chu2(y) m0 = -3/7; m1 = 4/7; alpha = 9; beta = 14; dy = zeros(3,1); dy(1) = alpha*(y(2) - y(1) - (.5)*(m0 - m1)*(abs(y(1) + 1) - abs(y(1) - 1))); dy(2) = y(1) - y(2) + y(3); dy(3) = -beta*y(2); [~,Y] = ode45(@chu2,[0 1 1]); plot3(Y)
Firstly, I thought the problem is because I gave not enough info, but I have checked everything.
Also I have a question about ODE45 – what method Matlab uses as it ? Runge–Kutta method ?* * Thank you for answering such dull question, but I am so desperate to find any mistake in my code, I have googled but that did not help.
Solution to this problem by Star Strider is to call not the chu2(y) but chu2(~,y)
Best Answer