Instrument Control Toolbox    

Cleaning Up the MATLAB Environment

When you no longer need the instrument object, you should remove it from memory with the delete function.

Before using delete, you must disconnect the object from the instrument with the fclose function.

A deleted instrument object is invalid, which means that you cannot connect it to the instrument. In this case, you should remove the object from the MATLAB workspace. To remove instrument objects and other variables from the MATLAB workspace, use the clear command.

If you use clear on an object that is connected to an instrument, the object is removed from the workspace but remains connected to the instrument. You can restore cleared instrument objects to MATLAB with the instrfind function.


  Disconnecting and Cleaning Up Controlling GPIB Instruments