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:
Configuration Parameters>Data Import/Export(seeModel Configuration Parameters: Data Import/Export(Simulink))
To Workspaceblocks
To Fileblocks
Scopeblocks with theLog data to workspaceparameter enabled
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 named
, wheremodel
.mat
is the name of your model.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 the
, allowing the generated program to run indefinitely, regardless of the stop time settingmodel
_step
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 class
FileScope
.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 class
ImportedExternPointer
or custom storage classes that yield nonaddressable data in the generated code. For example, the custom storage classGetSet
causes 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.Signal
object 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 |