removechannel
Syntax
Description
Examples
Remove Channels from DataAcquisition Interface
Remove channels from a DataAcquisition and note the index changes.
d = daq("directsound"); addinput(d,"Audio0","1","Audio"); addinput(d,"Audio1","1","Audio"); addoutput(d,"Audio3","1","Audio"); addoutput(d,"Audio6","1","Audio"); d.Channels
index Type Device Channel Measurement Type Range Name _____ ______ ________ _______ ________________ _______________ _____ 1 "audi" "Audio1" "1" "Audio" "-1.0 to +1.0 " "ch1" 2 "audi" "Audio0" "1" "Audio" "-1.0 to +1.0 " "ch2" 3 "audo" "Audio3" "1" "Audio" "-1.0 to +1.0 " "ch3" 4 "audo" "Audio6" "1" "Audio" "-1.0 to +1.0 " "ch4"
removechannel(d,2) d.Channels
index Type Device Channel Measurement Type Range Name _____ ______ ________ _______ ________________ _______________ _____ 1 "audi" "Audio1" "1" "Audio" "-1.0 to +1.0 " "ch1" 2 "audo" "Audio3" "1" "Audio" "-1.0 to +1.0 " "ch3" 3 "audo" "Audio6" "1" "Audio" "-1.0 to +1.0 " "ch4"
Note that after removal of the second channel, the remaining channels are numbered 1, 2, and 3. The channel names are not changed.
Remove all remaining channels.
removechannel(d,[1:length(d.Channels)])
Input Arguments
d
— DataAcquisition interface
DataAcquisition
object
DataAcquisition interface, specified as a DataAcquisition
object, created using the daq
function.
Example: d = daq()
idx
— Channel index
numeric scalar | numeric vector
Channel index, specified as a numeric scalar or vector. Removing a channel shifts down the indices of remaining higher channels, but does not change the channel names. Do not confuse the channel index in the DataAcquisition with the channel ID of the data acquisition device.
Example: [1,3]
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Version History
Introduced in R2020a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)