close all
clear all

 cmd = ['!cable.exe -in CIMT-Mooring.cab -out CIMT-Mooring.crs -quit -sample 0.2  -terminals -connectors -snap_dt 1 -DDEPLOY'];

 eval(cmd);
 
 deploy_spd = 3; %kts
 
 results_filenm = ['CIMTDeploy-',num2str(deploy_spd),'kts'];
 move = ['!mv CIMT-Mooring.crs ',results_filenm,'.crs'];
 eval(move);

 cmd = ['!res2mat.exe -in ',results_filenm,'.crs -out ',results_filenm,'.mat -totals -lbs'];
 eval(cmd);
 
 
 load(results_filenm);
 
 
 figure
 hold on

 plot(x_s(:,1),z_s(:,1)-70,'b-','LineWidth',2);

 plot(x_s,z_s-70);
 legend('Tow Profile',3);
 
 title(['Tow and Deployment Profile at ',num2str(deploy_spd),' knots']);
 xlabel('meters');
 ylabel('meters');
 
 
text(1,-2,'Ship ');
text(x_s(end,1)-1,-2,'Buoy');
text(-7.5,-72,'Deployment Profiles shown at 1 second intervals');

print('-depsc2',results_filenm);
%print('-dpdf',results_filenm);
