Store data for mux or bus signal


Simulink® software creates instances of this class to contain the data that it logs for a mux or bus signal. Other types of signals are stored in a Simulink.Timeseries. See Export Signal Data Using Signal Logging for more information.

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, consider the following model.

This model specifies that Simulink software should log the values of the signal b2 during simulation. After simulation of this model, the MATLAB® workspace contains a Simulink.ModelDataLogs object, named logsout, that contains a Simulink.TsArray object, named b2, that contains the logs for the elements of b2, i.e., for the elementary signal x1 and the bus signal b1. entering the fully qualified name of the Simulink.TsArray object, i.e., logsout.b2, at the MATLAB command line reveals the structure of the signal log for this model.

>> logsout.b2
Simulink.TsArray (untitled/Bus Creator1):
  Name                   elements   Simulink Class

  x1                        1       Timeseries
  b1                        2       TsArray

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 could enter the following at the MATLAB command line:

>> data = logsout.b2.x1.Data;


>> logsout.unpack('all');
data = x1.Data;

Introduced before R2006a

Was this topic helpful?