close all
clear all

results_path = 'X:\707976 EPBuoyPrototypeAndTesting\Deployments\Nov2012 Deployment\DecodedResults\'


figure('Position',[19 45 1538 1093],'PaperPositionMode','manual','PaperType','usletter','PaperPosition',[0 0 11 8.5],'PaperOrientation','landscape');
hold on

All_serialdate = [];
All_yawAngleTrue = [];
  dataDirs = dir([results_path 'R*']);
  for k = 2:4 %1:length(dataDirs)
    if(dataDirs(k).isdir == 1)
       path = [results_path dataDirs(k).name '/'];
       files = dir([path 'D*']);

       for i = 1:length(files)
        filename = files(i).name
        Results = load([results_path dataDirs(k).name '/' filename])
       
        %All_serialdate = [All_serialdate Results.serialdate];
        %All_yawAngleTrue = [All_yawAngleTrue Results.yawAngleTrue];
        idx = find(Results.serialdate >  7.35e+005);

        plot(Results.serialdate(idx),Results.yawAngleTrue(idx))

        
        clear Results;
       end
    end
  end
  
  datetick('x');
  xlabel('date');
  ylabel('Buoy Yaw Angle');
  title('PowerBuoy Yaw Behavior');
  print('-dpdf','YawBehavior/ExampleBuoyYaw.pdf');
