Class: Simulink.SimulationData.Dataset
Package: Simulink.SimulationData
Get element or collection of elements from dataset
[
returns
a datasetOut
,retIndex
]=find(datasetIn
,Name
,Value
,…)Simulink.SimulationData.Dataset
object and indices
of the elements whose property values match the specified property
names and values. Specify optional comma-separated pairs of Name,Value
properties. Name
is
the property name and Value
is the corresponding
value. Name
must appear inside single quotes ('
'
). You can specify several name-value pair properties in
any order as Name1,Value1,...,NameN,ValueN
.
[
matches
elements using regular expressions as if the value of the property
is passed to the datasetOut
,retIndex
]=find(datasetIn
,'-regexp',Name
,Value
,…)regexp
function as:
regexp(element.Name,Value)
-regexp
. If there is no -regexp
,
the method matches elements as if the value of the property is passed
as:isequal(element.Name,Value)
For more information on -regexp
, see -regexp With Multiple Block Paths.
-regexp
With Multiple Block Paths-regexp
works with properties of type char.
To specify multiple block paths, you can use Simulink.SimulationData.BlockPath
and Simulink.BlockPath
.
For example, when a signal is logged in a referenced model, you can
use Simulink.SimulationData.BlockPath
to specify
multiple block paths.
The method returns elements that contain a BlockPath property
where one or more of the individual block paths match the specified Value
path
when you use:
-regexp
with the BlockPath Name
property.
Value
as a character vector or
scalar object of type Simulink.SimulationData.BlockPath
with
one block path
You can use curly braces to streamline indexing syntax to get
an element in a dataset, instead of using find
.
The index must be a scalar that is not greater than the number of
elements in the variable. For example, get the second element of the logsout
dataset.
logsout{2}
Also, you can use the get
method to get an
element or collection of elements from a dataset.
addElement
| concat
| findobj
| get
| getElementNames
| numElements
| regexp
| setElement
| Simulink.SimulationData.BlockPath
| Simulink.SimulationData.Dataset
| Simulink.SimulationData.DatasetRef.getDatasetVariableNames
| Simulink.SimulationData.DataStoreMemory
| Simulink.SimulationData.Signal