Main Content

Format

Description

Specify data format for logging states, output, and final states data.

Category:Data Import/Export

Settings

Default:Dataset

Dataset

Logged states and outputs are each stored in aSimulink.SimulationData.Datasetobject. EachDatasetobject contains an element for each individual state or output. The data for each state or output is stored in atimeseriesobject by default except variable-size signal data. Variable-size signal data is always stored in atimetableobject that contains a cell array of signal values for each time step.

Array

Logged data is stored in 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 useArrayformat to log bus data.

Structure

State and output data each log to 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 root-levelOutportblock in the model.

Structure with time

The data logs to a structure with a time field and a signals field. The time field contains a vector of simulation times. The signals field contains the same data as theStructureformat.

Tips

  • When you log states and output data usingDataset:

    • 你可以在MATL处理记录数据AB®without a Simulink®license.

    • Logging supports saving multiple data values for a given time step, which can be required for logging data in aFor Iterator Subsystem, aWhile Iterator Subsystem, and Stateflow®.

    • Logged data automatically streams to theSimulation Data Inspectorduring simulation.

    • You can log variable-size signals using root-levelOutportblocks.

  • Datasetformat does not support:

    • Code generation.

    • Logging states inside a function-call subsystem.

    • Logging states during rapid accelerator simulations.

  • To useArrayformat, 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.

  • The format specified for theFormatparameter does not apply to final states data.

Command-Line Information

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

Recommended Settings

Application Setting
Debugging No impact
Traceability No impact
Efficiency No recommendation
Safety precaution No recommendation

Related Topics