User`s manual

Creating a Serial Port Object
8-25
Configuring Properties During Object Creation
You can configure serial port properties during object creation. serial accepts
property names and property values in the same format as the
set function.
For example, you can specify property name/property value pairs.
s = serial('COM1','BaudRate',4800,'Parity','even');
If you specify an invalid property name, the object is not created. However, if
you specify an invalid value for some properties (for example,
BaudRate is set
to 50), the object may be created but you will not be informed of the invalid
value until you connect the object to the device with the
fopen function.
The Serial Port Object Display
The serial port object provides you with a convenient display that summarizes
important configuration and state information. You can invoke the display
summary these three ways:
Type the serial port object variable name at the command line.
Exclude the semicolon when creating a serial port object.
Exclude the semicolon when configuring properties using the dot notation.
The display summary for the serial port object
s is given below.
Serial Port Object : Serial-COM1
Communication Settings
Port: COM1
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0