function sol = prob_4_6 % % Written by: % -- % John L. Weatherwax 2005-04-25 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- options = ddeset( 'RelTol', 1e-9, 'InitialY', [ 0 0 ] ); sol = dde23(@ddes,[1,2],@history,[0, 4]); plot(sol.x,sol.y(1,:),'-o'); grid on; function v = history(t) v = [ cos(t); sin(t) ]; function dydt = ddes(t,y,Z) dydt = [ Z(1,1)*Z(2,2); -y(1)*Z(2,2); ];