Save format
Format for logged states, output, and final states data
Model Configuration Pane: Data Import/Export
Description
The Save format parameter specifies the format for logged states,
output, and final states data. When you save final states with the complete model
operating point, the Save format parameter specifies the format of
the data in the loggedStates property of the
Simulink.op.ModelOperatingPoint object that contains the model
operating point. Signal logging and data store logging always use the
Dataset format.
The choice of save format does not affect the simulation results in terms of the
system behavior but can affect the content of the logged data. The
Dataset format logs time data for each signal, so logged
values reflect the sample rate for each output and state. The
Structure, Structure with
time, and Array formats share a single time
vector for all outputs and states, so the output and state data is logged using the
fundamental sample time for the model.
Settings
Dataset (default) | Array | Structure | Structure with timeDatasetLogged outputs, states, and final states are each stored in a
Simulink.SimulationData.Datasetobject. EachDatasetobject contains an element for each individual state or output. By default, the data for each state or output is stored in atimeseriesobject except variable-size signal data. Logged data for variable-size signals is always stored in atimetablethat contains a cell array of signal values for each time step. To specify whether to store data as atimeseriesobject or as atimetable, use the Dataset signal format parameter.You can process data logged using the
Datasetformat in MATLAB® without a Simulink® license.When you log states and output data using the
Datasetformat:Logging supports saving multiple data values for a given time step, which can be required for logging data in a For Iterator Subsystem, a While Iterator Subsystem, and Stateflow®.
Logged data automatically streams to the Simulation Data Inspector during simulation.
You can log variable-size signals using top-level Outport blocks.
You can use state and operating point data as the initial state for simulation of a model that contains bus-valued states.
Datasetformat does not support:Code generation.
Logging states inside a function-call subsystem.
Logging states during rapid accelerator simulations.
Logging states in simulations deployed using Simulink Compiler™
Logging final states in rapid accelerator and deployed simulations if one or more states in the model has any of these data types:
halfstringCharacter vector
Fixed-point
Logging final states if a referenced model that simulates in a mode other than normal contains one or more states that have any of these data types:
halfstringCharacter vector
Fixed-point
ArrayLogged outputs, states, and final states are each stored as a matrix. Each row in the matrix corresponds to a simulation time step, and each column corresponds to a state or output.
The order of the states and outputs in the matrix depends on the block sorted order, which can change from one simulation to the next. Do not use
Arrayformat to log bus data.To use
Arrayformat, all logged states and outputs must be:All scalars or all vectors (or all matrices for states)
All real or all complex
The same data type
Use another format if the outputs and states in your model do not meet these conditions.
StructureOutputs, states, and final states are each stored as a structure. The states structure contains a structure for each block in the model that has a state. The outputs structure contains a structure for each top-level output port.
Structure with timeOutputs, states, and final states are each logged to a structure that contains a field for time data as well as a field for the output or states data. The
timefield contains a vector of simulation times. Thesignalsfield contains the same data that is logged when you select theStructureformat.
Examples
Recommended Settings
The table summarizes recommended values for this parameter based on considerations related to code generation.
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No recommendation |
| Safety precaution | No recommendation |
Programmatic Use
Parameter:
SaveFormat |
| Type: string | character vector |
Value:
"Array" | "Structure" |
"StructureWithTime" | "Dataset" |
Default:
"Dataset" |
Version History
Introduced before R2006a
