xPC Target | ![]() ![]() |
Getting the Value of a Target Object Property
You can list a property value in the MATLAB window, or assign that value to a MATLAB variable. With xPC Target you can use either a function syntax or an object property syntax.
The syntax get(target_object
, property_name
) can be replaced by
target_object
.propety_name
For example, to access the start time:
endrun = tg.stoptime
endrun = get(tg,'stoptime') or tg.get('stoptime')
Signals are also target object properties. For example, to get the value of the Integrator1 signal from the model xpcosc:
outputvalue= tg.S0
outputvalue = get(tg, 's2') or tg.get('s2')
To get a list of readable properties, type target_object
. Without assignment to a variable, the property values are listed in the MATLAB window.
Note Method names are case-sensitive and need to complete, but property names are not case-sensitive and need not be complete as long as they are unique. |
![]() | Setting the Value of a Target Object Property from the Target PC | Using the Method Syntax with Target Objects | ![]() |