%LRUN     ODE solving example: Lorenz.
figure(1)
clf
xlabel('y_1','FontSize',14)
ylabel('y_3 ','FontSize',14,'Rotation',0,'HorizontalAlignment','right')
title('Lorenz equations','FontSize',16)

tspan = [0 50];                       % Solve for 0 <= t <= 50.
yzero = [0;1;0];                      % Initial conditions.
odestart = tic;
[t,y] = ode45(@lorenzde,tspan,yzero);   % @... function handle
toc(odestart)
disp(['finished ode45; starting plot'])
pause(1)
plot(y(:,1),y(:,3))                   % (y_1,y_3) phase plane.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp('hit enter to continue to build figure again using a for loop')
pause
clf
axis([-20 20 0 50])
xlabel('y_1','FontSize',14)
ylabel('y_3 ','FontSize',14,'Rotation',0,'HorizontalAlignment','right')
title('Lorenz equations','FontSize',16)
hold on
%%%%%%%%%%%%%%%%
for ii=1:2:size(y,1), 
plot(y(1:ii,1),y(1:ii,3))                   % (y_1,y_3) phase plane.
pause(.005);
end
hold off
