| Data Acquisition Toolbox | Search  Help Desk |
| makenames | Examples See Also |
Generate a list of channel or line names.
Syntax
names = makenames('prefix', index);
Arguments
Description
makenames generates a list of channel or line names. This list is to be passed as an input argument to the addchannel or addline function. The names are constructed by concatenating prefix and an index value. prefix must begin with a character and contain only characters and numbers. The number of hardware channels specified in addchannel or hardware lines specified in addline should agree with the number of indices specified in makenames.
Although makenames does not provide much flexibility in the descriptive names you can assign to channels or lines, it does provide you with a quick way to name a large number of channels or lines.
Example
National Instruments
Suppose you create the analog input objectAI for a National Instruments board and add eight input channels. You can use the makenames function to define descriptive names for each channel.
AI = analoginput('nidaq', 1);names = makenames('chan', 1:8);
names is an 8-element cell array of channel names chan1, chan2, . . ., chan8. You can now pass names as an input argument to the addchannel function.
addchannel(AI, 0:7, names);
See Also
Functions
addchannel, addline