set(0,'defaultaxesfontsize',12); set(0,'defaultlinelinewidth',2); set(0,'defaultlinemarkersize',6); 
path='YOURPATH';
axismin=datenum(2007,3,30); axismax=datenum(2007,3,31);
XTicks=[datenum(2007,1,1):datenum(2008,1,1)];
XTickLabels=datestr(XTicks,31);

%%%%%%%%%%%%%%%%%%%%%%    INPUT    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% change based on number of variables in your CR1000 output file
[timestring, trash, wspd, wdir, T, RH, R_sd] = ...
    textread(strcat(path,'YOUR FILENAME'),'%21c%u%f%f%f%f%f','delimiter',',','headerlines',4);

time = datenum( str2num(timestring(:,2:5)) , str2num(timestring(:,7:8)),str2num(timestring(:,10:11)) ,...
     str2num(timestring(:,13:14)) , str2num(timestring(:,16:17)) , str2num(timestring(:,19:20)));

%%%%%%%%%%%%%%%%%%%%%%   FIGURES   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure,set(gcf,'name','Wind Direction and Magnitude')
subplot(2,1,1),plot(time,wdir,'k.');
ylabel('Direction [Degrees]'), xlabel('Time')
set(gca,'XTick',XTicks,'XTickLabel',XTickLabels,'XGrid','on','YTick',[0 90 180 270 360],...
    'YTickLabel','0|90|180|270|360','YGrid','on','Box','on')
axis([axismin axismax 0 360])
subplot(2,1,2),plot(time,wspd,'k-');
ylabel('Speed [m/s]'), xlabel('Time')
set(gca,'XTick',XTicks,'XTickLabel',XTickLabels,'XGrid','on','Box','on')
axis([axismin axismax 0 10])

figure,set(gcf,'name','Temp and Hum')
subplot(2,1,1),plot(time,T,'k-');
ylabel('Temperature [C]'), xlabel('Time')
set(gca,'XTick',XTicks,'XTickLabel',XTickLabels,'XGrid','on','Box','on')
axis([axismin axismax -8 40])
subplot(2,1,2),plot(time,RH,'k-');
ylabel('RH [%]'), xlabel('Time')
set(gca,'XTick',XTicks,'XTickLabel',XTickLabels,'XGrid','on','Box','on')
axis([axismin axismax 0 100])

figure,set(gcf,'name','Radiation'),plot(time,R_sd,'k-');
ylabel('Solar Radiation [Wm^{-2}]'), xlabel('Time')
set(gca,'XTick',XTicks,'XTickLabel',XTickLabels,'XGrid','on','Box','on')
axis([axismin axismax -100 1150])
