| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Data Acquisition Toolbox |
| Contents | Index |
| Learn more about Data Acquisition Toolbox |
out = ischannel(obj.Channel(index))
obj.Channel(index) | One or more channels contained by obj. |
out | A logical value. |
out = ischannel(obj.Channel(index)) returns a logical 1 to out 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.
Typically, you use ischannel directly only when you are creating your own M-files.
Suppose you create the function myfunc for use with the Data Acquisition Toolbox software. If myfunc 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.
function myfunc(chan)
% Determine if a channel was passed.
if ~ischannel(chan)
error('The argument passed is not a channel.');
endYou can examine the Data Acquisition Toolbox software M-files for examples that use ischannel.
![]() | inspect | isdioline | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |