files=dir('C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\total_wind\*2.0*.dat');
u_comp=[];
wd=[];
ws=[];
for j=1:length(files)
    filename=files(j).name;
    mean_wind=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\total_wind\',filename]);
    
    
     wd=[wd mean_wind(:,2)];
%     for i=1:750
%         ang(i)=(wd(i)*pi)/180;
%         
%         
%         if ang(i)<=pi/2
%             u(i)=-sin(ang(i));
%             v(i)=-cos(ang(i));
%             
%             
%         elseif ang(i) > pi/2 & ang(i) <= pi
%             ang(i)=ang(i)-pi/2;
%             u(i)=-cos(ang(i));
%             v(i)=sin(ang(i));
%             
%         elseif ang(i) > pi & ang(i) <= 3*pi/2
%             ang(i)=ang(i)-pi;
%             u(i)=sin(ang(i));
%             v(i)=cos(ang(i));
%             
%         elseif ang(i) > 3*pi/2 & ang(i) <=2* pi
%             ang(i)=ang(i)-3*pi/2;
%             u(i)=cos(ang(i));
%             v(i)=-sin(ang(i));
%         else
%             u(i)=NaN;
%             v(i)=NaN;
%             
%         end
%     end
%     u=u';
%                size(u)
%                j
%                v=v';
%                size(v)
%                u_comp=[u_comp u];
%                v_comp=[v_comp v];
               ws=[ws mean_wind(:,1)];
               clear('u','v')
           end
%            wind.u=u_comp;
%            wind.v=v_comp;
           wind.ws=ws;
           