set( gcf, 'Name', 'Latch Variables' )

subplot( 2, 1, 1 )
cla
plot( time, [0.5*data(:,m_latchio1) + 0.75 0.5*data(:,m_latchio2) - 0.25], 'd' );
title( ['Pole in Latch Indicator: ' run_name] )
set( gca, 'YTick', [-0.25 0.25 0.75 1.25], 'YTickLabel', ...
    '|occupied||empty' )
xlabel( 'elapsed time (s)' );
zoom on

subplot( 2, 1, 2 )
cla
ind = find( finite(data(:,latch_check)) );
plot( time(ind), [NaN; diff(data(ind,latch_check))], '*', ...
    time, data(:,m_latchio0) + 1.5, 'd' );
set( gca, 'YLim', [-1.5 3], 'YTick', [-1 0 1 1.5 2.5], ...
    'YTickLabel', 'rel||req|off|on' )
zoom on
