| Data Acquisition Toolbox | Search  Help Desk |
| ischannel | Examples See Also |
Syntax
ischannel(obj.Channel(index))
Description
ischannel(obj.Channel(index)) returns a logical "1" if obj.Channel(index) is a channel. Otherwise, a logical "0" is returned. ischannel does not determine if channels are valid (associated with hardware). To check for valid channels, use the isvalid function.
Note:
ischannel directly only when you are creating your own M-files.
Example
Suppose you create the functionfunc for use with the Data Acquisition Toolbox. If func is passed one or more channels as an input argument, then the first thing you should do in the function is check if the argument is a channel.
You can examine the Data Acquisition Toolbox M-files for examples usingfunction func(obj.Channel)% Determine if a channel was passed.if ~ischannel(obj.Channel)error('The argument passed is not a channel.');end
ischannel.
See Also
Functions
delete, isvalid