This example shows how to use the forEachTimeseries
function
to run the min
function on each timeseries
object
in the logged data for the COUNTERBUS
signal.
Open the model and simulate it.
Access the signal logging data. For this model, that data
is stored in the topOut
variable.
Simulink.SimulationData.Dataset 'topOut' with 4 elements
Name BlockPath
____________ ________________________________________
1 [1x1 Signal] COUNTERBUS sldemo_mdlref_bus/Concatenate
2 [1x1 Signal] OUTERDATA sldemo_mdlref_bus/CounterA
3 [1x1 Signal] INCREMENTBUS sldemo_mdlref_bus/IncrementBusCreator
4 [1x1 Signal] INNERDATA ...erA|sldemo_mdlref_counter_bus/COUNTER
- Use braces { } to access, modify, or add elements using index.
Find the values for the COUNTERBUS
element.
counterbusData =
2×1 struct array with fields:
data
limits
Run the min
function on the counterbus
data.
ret =
2x1 struct array with fields:
data
limits
Explore the returned data.
ans =
data: 0
limits: [1x1 struct]
ans =
upper_saturation_limit: 40
lower_saturation_limit: 0