Format

Description

Select the data format for saving states, output, and final states data.

Category: Data Import/Export

Settings

Default: Dataset

Dataset

Simulink® uses a Simulink.SimulationData.Dataset object to store the logged data as MATLAB® timeseries objects.

Array

Simulink saves the data in a matrix. Each row corresponds to a simulation time step. Do not use Array format for bus signal data.

Structure

For logging output, Simulink saves the data in a structure that contains substructures for each port. Each port substructure contains signal data for the corresponding port. For logging states, the structure contains a substructure for each block with a state.

Structure with time

The format of the data is a structure that has two fields: a time field and a signals field. The time field contains a vector of simulation times. The signals field contains the same data as the Structure format.

Tips

  • The Dataset format for logged state and root outport data:

    • Uses MATLAB timeseries objects to store logged data. MATLAB timeseries objects allow you to work with logged data in MATLAB without a Simulink license.

    • Supports logging multiple data values for a given time step, important for Iterator subsystem and Stateflow® signal logging.

    • Supports logging Output data to the Simulation Data Inspector.

  • For states logging, Dataset format does not support:

    • Logging states information inside a function-call subsystem

    • Code generation

  • You can use array format to save model outputs and states only if the outputs:

    • Are all scalars or all vectors (or all matrices for states)

    • Are all real or all complex

    • Have the same data type

    Use the Dataset, Structure, or Structure with time output formats if your model outputs and states do not meet these conditions.

  • Rapid accelerator mode does not support Dataset format for states and final states.

  • If you enable the Save final operating point parameter, the specified format does not apply to final states data.

  • Simulink can read back simulation data saved to the workspace in the Structure with time output format. See Load Data to Root-Level Input Ports for more information.

Command-Line Information

Parameter: SaveFormat
Value: 'Array' | 'Structure' | 'StructureWithTime' | 'Dataset'
Default: 'Dataset'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo recommendation
Safety precautionNo recommendation

Related Topics