Store data logged by Scope signal viewer
Note: The Simulink.ScopeDataLogs class is used in conjunction with the ModelDataLogs logging data format. The ModelDataLogs format is supported for backwards compatibility. The ModelDataLogs format will be removed in a future release.
For new models, use the Dataset logging format. If you use the Dataset format for signal logging, then Simulink® does not log the signals configured to be logged in the Signal Viewer. Explicitly mark the signal for signal logging by using the Signal Properties dialog box. To access the Signal Properties dialog box, right-click a signal and from the context menu, select Properties.
Simulink software creates instances of this class to log data displayed on Scope viewers (see Visualize Results). In particular, if you have enabled data logging for a model, Simulink software creates an instance of this class for each scope viewer enabled for logging in the model and assigns it to a property of the model's Simulink.ModelDataLogs object. The instance created for each viewer has a Name property whose value is the name specified on the History pane of the viewer's parameter dialog box (see Scope for more information). The instance also has an axes property for each of the scope's axes labeled Axes1, Axes2, etc. The value of each axes property is itself a Simulink.ScopeDataLogs object that contains Simulink.Timeseries objects, one for each signal displayed on the axes. The time series objects contain the signal data displayed on the axes.
This model displays signals out1 and out2 on a scope viewer that has only one set of axes.
The model enables data logging for the scope viewer under the variable name ScopeData and for the model as a whole under the default variable name logsout.
After simulation of the model, the MATLAB® workspace contains a Simulink.ModelDataLogs object named logsout containing a Simulink.ScopeDataLogs object that in turn contains a Simulink.ScopeDataLogs object that contains Simulink.Timeseries objects that contain the times series data for signals out1 and out 2.
You can use Simulink data object dot notation to access the data, e.g.,
>> logsout.ScopeData.axes1 ans = Simulink.ScopeDataLogs (axes1): Name elements Simulink Class out1 1 Timeseries out2 1 Timeseries