MATLAB: Are To Workspace blocks ignored during code generation with Real Time Workshop 7.0 (R2007b)

codegenerationsimulink codertoworkspace

In the "Simulink Block Data Type support" help documentation it is written that "To Workspace" blocks are ignored during code generation.
When I create a simple model using a "To Workspace" and build it with "grt" or "ert" target, I always obtained a mat-file when I run the exe.file.
When I replace the "To Workspace" by an "output port" I don't obtain "the MAT-file when running the exe file.
I would like to know if "To Workspace" blocks are ignored during code generation with Real Time Workshop 7.0 (R2007b).

Best Answer

To Workspace blocks only impact generated code when doing MAT-file logging. When the To Workspace block is replaced with an output port no MAT-file is created because the "Data Import/Export" page in the configuration parameters window is configured to not log any outport data to the MAT-file (all of the "save to workspace" boxes are unchecked). The toWorkspace block ignores these fields and so the MAT-file is created.