%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PURPOSE: Plot the contents of dvlDataIn.log.
% AUTHOR:  rsm
% DATE:    00/10/24
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

 titleStr = ['; Data Set: ', DirName];
 
 if exist('dvlDataIn') ~= 1, 
    disp(' dvlDataIn is not present.')
    return, 
  end

  str = [' ',titleStr,' Plotted on ',myDate];
  PaperPosn = [.5 .5 3.75 2.5];
  FigurePosn = [5 30 815 760];
  i = 0;
  

  if exist( 'dvlfig' ) ~= 1
    dvlfig = figure;
    set(gcf,'position',FigurePosn)
  else
    figure(dvlfig);
  end
  set( dvlfig, 'Name', 'DVL Data', 'DeleteFcn', 'clear dvlfig' );

  subplot(3,1,1)
  plot(dvlDataIn(:,1), dvlDataIn(:,2:4))
  grid on 
  zoom on
  ylabel('Meters/Sec')
  title('Velocity In')

  subplot(3,1,2)
  dvlDataIn(1,5) = 1.1;
  plot(dvlDataIn(:,1), dvlDataIn(:,5))
  ylabel('True/False')
  title('Data Valid Flag')
  grid on 
  zoom on

  subplot(3,1,3)
  plot(dvlDataIn(:,1), sqrt(dvlDataIn(:,2:4).*dvlDataIn(:,2:4)*[1 1 1]'))
  line(dvlData(:,1),   sqrt(dvlData(:,2:4)  .*dvlData(:,2:4)  *[1 1 1]'),...
       'Color','r')
  ylabel('Speed, Meters/Sec')
  legend('In','Out')
  grid on 
  zoom on
  xlabel('Ticks')
  
