Why no output file from standalone Simulink Coder executable?

5 views (last 30 days)
I have a large Simulink model that was originally developed under R2012a and which I have ported to R2023b. All of the model ouputs are written to the MATLAB workspace using the "To Workspace" block. I've verified the presence of valid output data in the workspace when the model is executed from Simulink.
Next, I build a standalone Simulink Coder executable file from the model using slbuild(). I then run the executable, which appears to complete without any errors. However, it produces no output MAT-file. I've run the program both with and without the -o <results.mat> command line option.
I have no idea how to even begin to debug this!
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 23.2.0.2380103 (R2023b) Update 1
MATLAB License Number: 41135996
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------

Answers (1)

Mark McBroom
Mark McBroom on 21 Oct 2023
When running a .exe created from Simulink, there is no such thing as a "workspace" for the code to write to. You need to use a "fo file" block in the Simulink model.
  1 Comment
Hugh
Hugh on 25 Oct 2023
Edited: Hugh on 25 Oct 2023
I should probably have titled my posting "Rsim target no output". I'm attempting to run multiple simulations to study effects of varying parameter settings as described here. When I run the executable generated by Simulink Coder, I expect the contents of the "To Workspace" blocks in my model to appear in a MAT file. However, no MAT file is created.

Sign in to comment.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!