| Instrument Control Toolbox | ![]() |
Creating an Array of Instrument Objects
In MATLAB, you can create an array from existing variables by concatenating those variables together. The same is true for instrument objects. For example, suppose you create the GPIB objects g1 and g2:
You can now create an instrument object array consisting of g1 and g2 using the usual MATLAB syntax. To create the row array x:
x = [g1 g2] Instrument Object Array Index: Type: Status: Name: 1 gpib closed GPIB0-1 2 gpib closed GPIB0-2
Note that you cannot create a matrix of instrument objects. For example, you cannot create the matrix
z = [g1 g2;g1 g2]; ??? Error using ==> gpib/vertcat Only a row or column vector of instrument objects can be created.
Depending on your application, you might want to pass an array of instrument objects to a function. For example, using one call to the set function, you can configure both g1 and g2 to the same property value.
Refer to Function Reference, to see which functions accept an instrument object array as an input argument.
| Configuring Properties During Object Creation | Connecting to the Instrument | ![]() |