User`s guide
2 Targets and Scopes in the MATLAB
®
Interface
Getting the Value of a Scope Property
You can list a property value in the MATLAB window or assign that value
to a MATLAB variable. With the xPC Target software you can use either a
function syntax or an object property sy ntax.
The syntax
get(scope_object_vector, property_name) can be replaced by
scope_object_vector(index_vector).property_name
For example, to assign the number of samples from the scope object sc1,
• In the MATLAB window, type
numsamples = sc1.NumSamples
• Alternatively, you can type
numsamples = get(sc1,'NumSamples')
or
sc1.get(NumSamples)
Note that y ou cannot u se dot notation to get the values of vecto r o bject
properties. To g et properties of a vector of scopes, use the
get method. For
example, assume you have two scopes,
1 and 2, assigned to the variable sc12.
To get the value of
NumSamples for these scopes, in the MATL AB window, type
get(sc12,'NumSamples')
You get a result like the following:
ans =
[300]
[300]
To get a list of readable properties, type scope_object. The property values
are listed in the MATLAB window.
2-10