Save Run-Time Data from Simulation
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
timetable objects, which you
can process with MATLAB.
To determine which approach to use for logging data, see Save Simulation Data.
|Instrumentation Properties||View and edit logging and visualization properties for logged signal|
|Signal Properties||View and edit signal properties|
|Simulation Data Inspector||Inspect and compare data and simulation results to validate and iterate model designs|
|Simulink Signal Logging Selector||View signal logging configuration and override signal logging settings|
Configure Signal Logging
Override Signal Logging Settings
|Find index of signals in |
|Set logging mode for top model or top-level Model block|
|Determine whether model logs as specified in model or uses override settings|
|Verify paths in |
Limit Logged Data Size
Configure Logged Data Size Limits
|Specify maximum size for data logged to disk (Since R2021a)|
|Get configured maximum size for data logged to disk (Since R2021a)|
|Specify minimum disk space to leave free when logging data (Since R2021a)|
|Get configured minimum disk space requirement for logging (Since R2021a)|
|Specify behavior when logged data size approaches configured limits (Since R2021a)|
|Get configured behavior when size of logged data approaches configured limits (Since R2021a)|
|Specify record mode for logging (Since R2021a)|
|Check record mode for logging (Since R2021a)|
Configure Simulation Data Inspector Archive
|Specify number of runs to retain in Simulation Data Inspector archive|
|Specify how Simulation Data Inspector manages simulation runs|
|Get limit for number of runs to retain in Simulation Data Inspector archive|
|Get Simulation Data Inspector run management mode|
Configure Logging Location
|Specify location for logged data on disk (Since R2021a)|
|Get path to custom storage location for data logged to disk (Since R2021a)|
|Specify whether to log data to disk or memory (Since R2021a)|
|Check if logging is configured to log data to disk or memory (Since R2021a)|
Process Logged Data
|Extract data from |
|Remove element from |
|Create structure of |
|Apply function to data contained in set of |
|List names of variables in MAT file that contain
Access Logged Simulation Data
|Access simulation outputs and metadata|
|Access metadata of simulation runs|
|Access logged simulation data or group simulation input data|
|Container for signal logging information|
|State logging element|
|Datastore for inputs and outputs of Simulink models|
|Fully specified Simulink block path|
|Store units for simulation data|
|Signal logging override settings|
|Signal logging override settings for model|
|Signal logging override settings for signal|
Specify Data to Log
|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 (Since R2019a)|
Specify Logged Data Format
|Single simulation output||Option to return simulation results as single
|Format||Format for logged states, output, and final states data|
|Log Dataset data to file||Option to log data that uses |
|Record logged workspace data in Simulation Data Inspector||Option to send data logged in format other than |
Specify Values to Log
|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|
- Save Simulation Data
Save simulation data for analyzing and debugging a model.
- View and Access Logged Simulation Data
View and access saved simulation data for a completed or paused simulation.
- Data Format for Logged Simulation Data
You can use many formats for logged data, including
timeseries, arrays, and structures. Supported data formats vary between different logging techniques. However,
Datasetformat is available for all logging techniques.
- Log Data to the Workspace and a File Using the Record Block
Use the Record block to log data to the workspace, to a file, or to both the workspace and a file.
- Convert Data to Dataset Format
To convert a workspace variable that contains data that was logged in a format other than
Datasetformat to use
Datasetformat, use a
- Samples to Export for Variable-Step Solvers
Control how much output the simulation generates when your model uses a variable-step solver. Use the Output options configuration parameter.
- Save Signal Data Using Signal Logging
Capture signal data from a simulation by marking signals you want to log in the model.
- Override Signal Logging Settings
For a specific simulation run, override the signal logging settings for individual signals marked for logging.
- View the Signal Logging Configuration
View the signals that are marked for signal logging.
- Visualize and Access Signal Logging Data
View and access the signal logging data for a completed or paused simulation.
- Access Logged Signals with Spaces and Newlines in Logged Names
Access logged signals with names that contain spaces or newlines.
- Work with Big Data for Simulations
Log, load, and analyze big data for simulations.
- Limit the Size of Logged Data
Choose among several strategies to limit the size of logged data.
- Specify Signal Values to Log
Specify which signal values to log during simulation.
- Log Data to Persistent Storage
Store logged simulation data to persistent storage in a MAT-file.
- Analyze Big Data from a Simulation
Access simulation data logged to persistent storage for analysis in MATLAB.
- Log Data Stores
Configure a data store for logging so that you can view the data stored in a simulation run.