Documentation

MAT-file logging

Description

Specify MAT-file logging

Category:Code Generation > Interface

Settings

Default:on for the GRT target, off for ERT-based targets

On

Enable MAT-file logging. When you select this option, the generated code saves to MAT-files simulation data specified in one of the following ways:

In simulation, this data would be written to the MATLAB®workspace, as described inExport Simulation Data(Simulink) andConfigure Signal Data for Logging. Setting MAT-file logging redirects the data to a MAT-file instead. The file is namedmodel.mat, wheremodelis the name of your model.

Off

Disable MAT-file logging. Clearing this option has the following benefits:

  • Eliminates overhead associated with supporting a file system, which typically is not a requirement for embedded applications

  • Eliminates extra code and memory usage required to initialize, update, and clean up logging variables

  • Under certain conditions, eliminates code and storage associated with root output ports

  • Omits the comparison between the current time and stop time in themodel_step, allowing the generated program to run indefinitely, regardless of the stop time setting

Dependencies

  • When you selectMAT-file logging, you must also select the configuration parametersSupport: non-finite numbersand, if you use an ERT-based system target file,Support: floating-point numbers.

  • Selecting this option enablesMAT-file variable name modifier.

  • For ERT-based system target files, clear this parameter if you are using exported function calls.

Limitations

  • The code generator does not support MAT-file logging for custom data types (data types that are not built into Simulink®).

  • MAT-file日志不支持file-scoped数据万博1manbetx, for example, data items to which you apply the built-in custom storage classFileScope.

  • In a referenced model, only the following data logging features are supported:

    • To Fileblocks

    • State logging — the software stores the data in the MAT-file for the top model.

  • In the context of the Embedded Coder®product, MAT-file logging does not support the following IDEs:Analog Devices®VisualDSP++®,Texas Instruments™ Code Composer Studio™, Wind River®DIAB/GCC.

  • MAT-file logging does not supportOutportblocks to which you apply the storage classImportedExternPointeror custom storage classes that yield nonaddressable data in the generated code. For example, the custom storage classGetSetcauses theOutportto appear in the generated code as a function call, which is not addressable. This limitation applies whether you apply the storage class directly by using, for example, the Model Data Editor, or by resolving theOutportto aSimulink.Signalobject that uses the storage class. As a workaround, apply the storage class to the signal that enters theOutportblock.

Command-Line Information

Parameter:MatFileLogging
Type:character vector
Value:'on'|'off'
Default:'on'for the GRT target,'off'for ERT-based targets

Recommended Settings

Application Setting
Debugging On
Traceability No impact
Efficiency Off
Safety precaution Off

Related Topics

Was this topic helpful?