clear
close all
R=input('What is the name of the data file (eg, mbari_deploy)?  ','s');
eval(['load ', R])

N=find(abs(z_t(:,1)==0)); 
a=1:N(1);
dt=t(2)-t(1);
t=t(a);
Ten=T_t(a,1:3);

figure(1)
clf
plot(t,Ten(:,2),t,Ten(:,3),'r:',t,Ten(:,1),'k-.')
legend('Below the surface buoy','At the junction','At the anchor')
title('Tension below the surface buoy, at the junction, and at the anchor (lbf)')
xlabel('Time (s)')
ylabel('Tension (lbf)')


figure(2)
clf
subplot(2,1,1)
plot(x,z,'r.',x_s,z_s)
%The red dotted line is just before the anchor was dropped
title('Snapshots')
text(x(100),z(1)+50,'initial')
text(-500,500,'final')
ylabel('Depth (m)')
xlabel('Horizontal coordinate (m)')
subplot(2,1,2)
plot(s, T, 'r.', s,T_s)
title('Tension snapshots')
ylabel('Tension (lbf)')
xlabel('Lagrangian coordinate (m)')
Tf=-round(x_t(N(1)-1));
maxT=round(max(max(Ten)));
['The final location of the anchor is ', num2str(Tf),' meters behind where it was dropped.']
['It took ', num2str(t(N(1)-1)), ' seconds for the anchor to reach the bottom.']
['The maximum tension achieved anywhere during deployment is ', num2str(maxT), ' lbf']
