External Interfaces/API    

Creating an Array of Serial Port Objects

In MATLAB, you can create an array from existing variables by concatenating those variables together. The same is true for serial port objects. For example, suppose you create the serial port objects s1 and s2

You can now create a serial port object array consisting of s1 and s2 using the usual MATLAB syntax. To create the row array x

To create the column array y

Note that you cannot create a matrix of serial port objects. For example, you cannot create the matrix

Depending on your application, you might want to pass an array of serial port objects to a function. For example, to configure the baud rate and parity for s1 and s2 using one call to set

Refer to the serial port function reference to see which functions accept a serial port object array as an input.


  The Serial Port Object Display Connecting to the Device