Save Run-Time Data from Simulation - MATLAB & Simulink (original) (raw)

Save simulation data such as output, signal, time, state, and data store logging data

You can save simulation data to the MATLAB® workspace or to a file, including an MLDATX file, MAT file, or Excel® file, during simulation for later retrieval and postprocessing. Simulation data can include any combination of output, signal, time, state, and data store logging data.

Saving simulation data in Dataset format simplifies postprocessing by providing a common format for the results of a variety of logging techniques. Using Dataset format stores the data as MATLABtimeseries or timetable objects, which you can process with MATLAB.

To determine which approach to use for logging data, see Save Simulation Data.

Blocks

Outport Create output port for subsystem or external output
Record View and log data to the workspace, a file, or both (Since R2021a)
To File Write data to file
To Workspace Log data to workspace from Simulink model

Tools

Functions

expand all

Configure Logged Data Size Limits

Configure Simulation Data Inspector Archive

Objects

Model Settings

expand all

Time Option to log time values for simulation
Output Option to log data for top-level output ports
States Option to log block state values during simulation
Signal logging Option to log data for signals marked for logging in model
Data stores Option to log data for Data Store Memory blocks
Final states Option to log final state values
Save final operating point Option to save complete model operating point when simulation is paused or stopped
Decimation Option to apply decimation factor for logged output, state, and time data
Limit data points to last Option to log only last n data points for outputs, states, and time
Logging intervals Option to specify time intervals in which to log simulation data
Output options Options to produce output values at specified times in variable-step simulation
Output times Option to specify times for which variable-step simulation produces output values
Refine factor Option to produce additional output values between simulation time steps

Topics

Simulation Data

Signal Logging

Big Data

Simulation State

Data Stores