Data Acquisition Toolbox | ![]() ![]() |
Store data that you want to associate with a device object
Description
UserData
stores data that you want to associate with the device object.
Characteristics
Usage |
AI, AO, DIO, Common |
Access |
Read/write |
Data type |
Any type |
Read-only when running |
No |
Values
The default value is an empty vector.
Example
Create the analog input object ai
and add two channels to it.
ai = analoginput('nidaq',1); addchannel(ai,0:1);
Suppose you want to access filter coefficients during the acquisition. You can create a structure to store these coefficients, which can then be stored in UserData
.
coeff.a = 1.0; coeff.b = -1.25; set(ai,'UserData',coeff)
![]() | UnitsRange | Device-Specific Property Reference | ![]() |