Specify descriptive channel name
Note: You cannot use the legacy interface on 64-bit MATLAB®. See Working with the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
ChannelName specifies a descriptive name for a hardware channel. If a channel name is defined, then you can reference that channel by its name. If a channel name is not defined, then the channel must be referenced by its index. Channel names are not required to be unique.
You can also define descriptive channel names when channels are added to a device object with the addchannel function.
The default value is an empty string. To reference a channel by name, it must contain only letters, numbers, and underscores and must begin with a letter.
Create the analog input object ai for a sound card and add two channels to it.
ai = analoginput('winsound'); addchannel(ai,1:2);
To assign a descriptive name to the first channel contained by ai:
Chan1 = ai.Channel(1) Chan1.ChannelName = 'Joe'
You can now reference this channel by name instead of by index.
ai.Joe.Units = 'Decibels'