| Contents | Index |
get(obj)
out = get(obj)
out = get(obj,'PropertyName')
get(obj) returns all property names and their current values to the command line for the serial port object, obj.
out = get(obj) returns the structure out where each field name is the name of a property of obj, and each field contains the value of that property.
out = get(obj,'PropertyName') returns the value out of the property specified by PropertyName for obj. If PropertyName is replaced by a 1-by-n or n-by-1 cell array of strings containing property names, then get returns a 1-by-n cell array of values to out. If obj is an array of serial port objects, then out will be a m-by-n cell array of property values where m is equal to the length of obj and n is equal to the number of properties specified.
Refer to Displaying Property Names and Property Values for a list of serial port object properties that you can return with get.
When you specify a property name, you can do so without regard to case, and you can make use of property name completion. For example, if s is a serial port object, then these commands are all valid.
out = get(s,'BaudRate'); out = get(s,'baudrate'); out = get(s,'BAUD');
If you use the help command to display help for get, then you need to supply the pathname shown below.
help serial/get
This example illustrates some of the ways you can use get to return property values for the serial port object s on a Windows platform.
s = serial('COM1');
out1 = get(s);
out2 = get(s,{'BaudRate','DataBits'});
get(s,'Parity')
ans =
none
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |