Data Acquisition Toolbox | ![]() ![]() |
Creating an Array of Device Objects
In MATLAB, you can create an array from existing variables by concatenating those variables together. The same is true for device objects. For example, suppose you create the analog input object ai
and the analog output object ao
for a sound card:
You can now create a device object array consisting of ai
and ao
using the usual MATLAB syntax. To create the row array x
:
Note that you cannot create a matrix of device objects. For example, you cannot create the matrix
z = [ai ao;ai ao]; ??? Error using ==> analoginput/vertcat Only a row or column vector of device objects can be created.
Depending on your application, you might want to pass an array of device objects to a function. For example, using one call to the set
function, you can configure both ai
and ao
to the same property value.
Refer to Function Reference, to see which functions accept a device object array as an input argument.
![]() | Creating a Device Object | Where Do Device Objects Exist? | ![]() |