reverse-shooting

Matlab scripts for reverse shooting
Log | Files | Refs | README

lineofarrows.m (568B)


      1 function []=lineofarrows(a,b,numarrows,angle);
      2 %  Creates a line of arrows from point a to point b, 
      3 %  e.g. to show dynamics in a Solow Diagram
      4 %   numarrows = # of arrows between the points
      5 
      6 if exist('angle')~=1; angle=30; end;
      7 xstep=b(1)-a(1);
      8 ystep=b(2)-a(2);
      9 xinc=xstep/(numarrows+1);
     10 yinc=ystep/(numarrows+1);
     11 
     12 aa=a;
     13 s=.07;  % start just a little bit on the way...
     14 aa(1)=aa(1)+s*xstep;
     15 aa(2)=aa(2)+s*ystep;
     16 for i=1:numarrows;
     17   bb(1)=aa(1)+xinc;
     18   bb(2)=aa(2)+yinc;
     19   % Now using the arrow.m file I downloaded.
     20   arrow(aa,bb,18,'BaseAngle',angle)
     21   aa=bb;
     22 end;
     23