% compute our trajectory
dt = .01;tspan = 0:dt:4;Y(:,1) = y0;yk = y0;for i=1:length(tspan) time= i*dt; ykplus1=rk4singlestep(@(t,y)lorenz(t,y,sigma,beta,rho),dt,time,yk); Y =[Y ykplus1]; yk = ykplus1;endplot3(Y(1,:),Y(2,:),Y(3,:),'b')
MATLAB: Where in the code using runge- kutta four step method did I make a mistake
lorenz's parameters and rk4singlestep
Best Answer