echo off
clear
i=4;
   eval(['load lat' int2str(i)])
   eval(['load fs' int2str(i)])
   eval(['load t' int2str(i)])
   eval(['load l' int2str(i)])

   [m n]=size(l);
   if m<n
      lat=lat';
      l=l';
      t=t';
      fs=fs';
   end
   pack
j=1;
      dk=(j-1)*600;
   for k=1:133
      kk=k+dk;
      afi=rot_s(-d_r(lat(kk)),'y');   % ¢à é¥­¨¥ ¯® è¨à®â¥
      for ll=1:2
         al=rot_s(-d_r(l(kk,ll)),'z'); % ¯® lambda
         at=rot_s(-d_r(t(kk,ll)),'x'); % ¯® teta
         af=rot_s(d_r(fs(kk,ll)),'z'); % ¯® fi(s)
         v(k,3*ll-2:3*ll)=[1,0,0]*(al*at*af*afi);
      end
      if mod(k,100)==0
         disp([i j k kk/10])
      end
   end
   pack
   v=v';
   ii=(i-1)*5+j;
   disp(['save v' int2str(ii) ' v'])
   eval(['save v' int2str(ii) ' v'])
