
clear ;
figure ;

last_time = 100 ;
h = 0.01 ;
steps = last_time / h ;

y1 = [-3;44;17] ;
time = 0 ;
p = plot3(y1(1),y1(2),y1(3),'.', 'EraseMode','none','MarkerSize',3);
axis([-20 20 -20 20 -20 80]);
hold on

for i = 1:steps
  [t,y]= ode23('matlorenz',[time,time+h],y1);
  l = length(y) ;
  y1 = [y(l,1) y(l,2) y(l,3)];
  set(p,'XData',y1(1),'YData',y1(2),'ZData',y1(3))
  drawnow 
  time = time+h ;
end

      