Main Content

Log Dataset data to file

Description

Log simulation data saved using theDatasetformat to a MAT-file.

Category:Data Import/Export

Settings

Default:'off'

On

Enables logging data saved using theDatasetformat to a MAT-file.

Log simulation data to a MAT-file when you know prior to simulation that you want to save the results in a file.

Specify the path and file name for the MAT-file.

Off

Disables logging simulation data to a MAT-file.

Tips

  • To use theLog Dataset data to fileoption, select one or more of these types of data to log:

    • States

    • Final states

    • Signal logging

    • Output

    • Data stores

    • Stateflow®states and data

    If you are logging states or output data, set theFormatparameter toDataset.

    If you select theFinal statesparameter, clear theSave final operating pointparameter.

  • When the data in the MAT-file fits into memory, use theloadfunction to access the data.

  • When the data in the MAT-file is too large to fit into memory, access the data in the MAT-file usingSimulink.SimulationData.DatasetRefandmatlab.io.datastore.SimulationDatastoreobjects.

  • Except for parallel simulations, Simulink®overwrites the contents of the MAT-file during each simulation unless you change the name of the file between simulations. For details, seeSave Logged Data from Successive Simulations.

Dependencies

Select theLog Dataset data to filecheck box before entering the path to the MAT-file for logging.

Command-Line Information

Parameter:LoggingToFile
Value:'on'|'off'
Default:'off'
Parameter:LoggingFileName
Value:valid path and file name
Default:'out.mat'

Recommended Settings

Application Setting
Debugging No impact
Traceability No impact
Efficiency

No recommendation

Safety precaution

No recommendation

See Also

||

Related Topics