Store data for mux or bus signal
Note
Before R2016a, the Simulink.TsArray
class
was used in conjunction with the ModelDataLogs
logging
data format. Starting in R2016a, you cannot log data in the ModelDataLogs
format.
Signal logging uses the Dataset
format.
However, you can use data that was logged in a previous release
using ModelDataLogs
format.
In releases earlier than R2016a, Simulink® software created
instances of this class to contain the data that it logs for a mux
or bus signal. Other types of signals were stored in a Simulink.Timeseries
.
Objects of the Simulink.TsArray
class have
a variable number of properties. The first property, called Name
,
specifies the log name of the logged signal. The remaining properties
reference logs for the elements of the logged signal: Simulink.Timeseries
objects
for elementary signals and Simulink.TSArray
objects
for mux or bus signals. The name of each property is the log name
of the corresponding signal.
For example, suppose you have this logged data from a model
run in a release earlier than R2016a that was configured to log in ModelDataLogs
format.
logsout.b2
Simulink.TsArray (untitled/Bus Creator1): Name elements Simulink Class x1 1 Timeseries b1 2 TsArray
The Simulink.ModelDataLogs
object, named logsout
,
contains a Simulink.TsArray
object, named b2
,
that contains the logs for the elements of b2
(that
is, the elementary signal x1
and the bus signal b1
).
Entering the fully qualified name of the Simulink.TsArray
object,
(logsout.b2
) at the MATLAB® command line reveals
the structure of the signal log for this model.
You can use either fully qualified log names or the unpack
command to access the signal
logs contained by a Simulink.TsArray
object. For
example, to access the amplitudes logged for signal x1
in
the preceding example, you can enter the following at the MATLAB command
line:
data = logsout.b2.x1.Data;
or
logsout.unpack('all');
data = x1.Data;
Simulink.ModelDataLogs
, Simulink.SubsysDataLogs
, Simulink.Timeseries
, Simulink.SimulationData.Dataset
, who
, whos
, unpack