%    WPT - script to plot waypoint cross track error.
%
%    B. A. Moran, 09-May-1997

%    Copyright (C) 1997-1998
%    Massachussetts Institute of Technology
%    Sea Grant AUV Laboratory
%    $Id: wpt.m,v 1.1 2000/01/10 19:08:45 rob Exp $	

if exist( 'wp_xte' ) ~= 1 | exist( 'wp_dtw' ) ~= 1
    warning( 'WP_XTE or WP_DTW not available' )
    return
end

if exist( 'h_wpt' ) ~= 1
    h_wpt = figure;
else
    h_wpt = figure(h_wpt);
end

set( h_wpt, 'Name', 'Odyssey II Waypoints', 'DeleteFcn', 'clear h_wpt' );

subplot( 2, 1, 1 )
plot( data(:,m_present_time), data(:,wp_dtw) );
title( ['Waypoint Performance: ' run_name] );
ylabel( 'DTW (m)' );

subplot( 2, 1, 2 )
plot( data(:,m_present_time), data(:,wp_xte) );
xlabel( 'elapsed time (s)' );
ylabel( 'XTE (m)' );

zoom on
