Save Simulink's logged data to a MAT file
cm_model_logs_saveWrite Simulink logged signals and To Workspace blocks from a CarMaker run to a MAT file, including base and model workspace variables.
Instructions
After a CarMaker for Simulink run: write what Simulink logged (signals marked for logging and To Workspace blocks) to a MAT file, with the base workspace and the model workspace as one struct each (variables: signals, base_workspace, model_workspace, info). Requires an idle simulation. The result file (.erg) holds CarMaker's quantities; this holds the Simulink side.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | MAT file to write, inside the project (default: next to the last result file, with the same name) | |
| logs | No | inspector: every signal the Simulation Data Inspector holds for the last run (logged signals and To Workspace blocks, complete). workspace: the logging variables in the base workspace as they are | inspector |
| model | No | Loaded Simulink model (default: the active one) | |
| format | No | dataset: a Simulink.SimulationData.Dataset. struct: plain arrays (name, time, values, units, block) that load without Simulink | dataset |
| overwrite | No | Replace the file if it exists | |
| timeout_s | No | Longest time MATLAB may take to write the file | |
| base_workspace | No | Include the base workspace's variables | |
| model_workspace | No | Include the model workspace's variables |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||