% AMLlistenCLOSE -- Matlab version 1.0.2
% Will_Ferenc@hmc.edu
% 6/22/2011 UCLA Applied Math Lab
% 2011 Applied Math REU 

%=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-USAGE-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
% AMLlistenCLOSE is a matlab script that closes all of the connections made
% by AMLlistenOPEN. Run this script after you are finished. If this script
% is not run you will not be able to reconnect to the device without
% restarting matlab. Package instructions summary follows.
%
% 0. Obtain and load AMLCOM and a listening script (eg. AMLlistenOPEN)
% 1. Find IP address of both computers (google "find my IP address")
% 2. Input IP address of the remote computer for each script
% 3. Run scripts in tandem. (If not they will timeout and error)
% 4. Wait for prompt, then activate the AML car, then press any key
% 5. Check receiving computer for results. Perhaps use fread(t,#bytessent)
%-------------------------------------------------------------------------


fclose(t)
delete(t)
clear t
instrfind % confirms to user port closed by absence of port