Simulink.ModelDataLogs - Container for model's signal data logs

Description

Simulink software creates instances of this class to contain signal logs that it creates while simulating a model (see Logging Signals). In particular, Simulink software creates an instance of this class for a top-level model and for each model referenced by the top-level model that contains signals to be logged. Simulink software assigns the ModelDataLogs object for the top-level model to a variable in the MATLAB workspace. The name of the variable is the name specified in the Signal logging name field on the Data Import/Export pane of the model's Configuration Parameters dialog box. The default value is logsout.

A ModelDataLogs object has a variable number of properties. The first property, named Name, specifies the name of the model whose signal data the object contains or, if the model is a referenced model, the name of the Model block that references the model. The remaining properties reference objects that contain signal data logged during simulation of the model. The objects may be instances of any of the following types of objects:

The names of the properties identify the data being logged as follows:

Consider, for example, the following model.

As indicated by the testpoint icons, this model specifies that Simulink software should log the signals named step and scope in the model's root system and the signal named clk in the subsystem named Delayed Out. After simulation of this model, the MATLAB workspace contains the following variable:

>> logsout
 
logsout =
 
Simulink.ModelDataLogs (siglgex):
  Name                   Elements  Simulink Class

  scope                     2      TsArray
  step                      1      Timeseries
  ('Delayed Out')           2      SubsysDataLogs

The logsout variable contains the signal data logged during the simulation. You can use fully qualified object names or the Simulink unpack command to access the signal data stored in logsout. For example, to access the amplitudes of the clk signal in the Delayed Out subsystem, enter

>> data = logsout.('Delayed Out').clk;

or

>> logsout.unpack('all');
>> data = clk;

You can use a custom logging name or signal name when logging a signal. If you choose to use the signal name, and that signal name is a multiline one, seen in the following:

include an sprintf('\n') between the two lines of the signal name when accessing the logged data. For example,

logsout.(['scope' sprintf('\n') '(delayed out)'])

See Also

Simulink.Timeseries, Simulink.TsArray, Simulink.SubsysDataLogs, Simulink.ScopeDataLogs, unpack

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS