MATLAB: I can not use some functions for NI device

functionni product

[EDIT: 20110720 23:36 CDT – reformat – WDR]
Hi, guys,
I found I can not use some functions when I tried to acquire data with ni product usb-6251.
for example,
s = daq.createSession('ni'),daq.getDevices,addAnalogInputChannel.
I can not use them, the error is: Undefined variable "daq" or class "daq.createSession". Undefined function or variable 'daq'.and so on. what's the matter?
I can use analoginput('nidaq','Dev1'),but I can not add channels.
please
thank you

Best Answer

I believe that after
s = daq.createSession('ni')
you would need to use
s.addAnalogInputChannel(...)
to add a channel. See the example here
Related Question