| Data Acquisition Toolbox | Search  Help Desk |
| delete | Examples See Also |
Delete device objects, channels, or lines.
Syntax
delete(obj)
delete(obj.Channel(index))
delete(obj.Line(index))
Description
delete removes device objects, channels, or lines from the data acquisition engine and the MATLAB workspace. If multiple references to a device object exist in the workspace, removing one reference invalidates the remaining references. These remaining references should be cleared from the workspace. delete should be used at the end of a data acquisition session. If delete is issued and the Running property is set to On, the device object, channels, or lines will not be deleted and an error will be returned.
delete(obj) removes the device object including all associated channels or lines. If obj is the last object accessing the driver, then the driver and associated adaptor are closed and unloaded.
delete(obj.Channel(index)) removes the channels specified by index from obj. As a result, the remaining channels may be reordered.
delete(obj.Line(index)) removes the lines specified by index and from obj. As a result, the remaining lines may be reordered.
Examples
Sound Cards
Suppose you create the analog input objectAI1 for a sound card, and configure it to operate in stereo mode.
You can now configure the sound card for mono mode by deleting hardware channel 2.AI1 = analoginput('winsound')addchannel(AI1, 1:2)
delete(AI1.Channel(2))
National Instruments
Suppose you create the analog input objectai for a National Instruments board, add hardware channels 0-7 to it, and make a copy of channels 0 and 1.
To delete channels 0 and 1ai = analoginput('nidaq', 1)addchannel(ai, 0:7)ch = ai.Channel(1:2)
delete(ch)
ai. The remaining channels are reindexed such that the indices begin at 1 and increase monotonically to 14.
To delete the analog input object
delete(ai)
See Also
Functions
clear, daqreset