Products & Services Solutions Academia Support User Community Company

Learn more about Data Acquisition Toolbox   

Cleaning Up

When you no longer need a device object, you should clean up the MATLAB workspace by removing the object from memory (the engine) and from the workspace. These are the steps you take to end a data acquisition session.

You remove device objects from memory with the delete function. For example, to delete the analog input object ai created in the preceding section:

delete(ai)

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

clear ai

If you use clear on a device object that is connected to hardware, the object is removed from the workspace but remains connected to the hardware. You can restore cleared device objects to the MATLAB workspace with the daqfind function.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS