How can I close the report window after code generation using rtwbuild() from a Simulink model from the command line ?

12 views (last 30 days)
Hi,
I'm trying to automate the building process of my Simulink models. I achieve to handle the configuration of these models as I want.
Then I start generation using the command :
rtwbuild('system', 'Mode', 'ExportFunctionCalls');
That's working pretty well. At the end of the generation, a window appears showing a report of the generation allowing me to browse the just generated code.
My script builds several models and I would like to close this window after each model generation in order to don't disturb the user with all those reports "poping out".
An even better solution would be to not even show this window. I don't need to see it in my generation process and I don't want the user to click the OK button for each report.
So, is there a way to prevent rtwbuild() command to show this report when it's done ? Or at least, is there a way to close this window from the command line after the generation ?

Answers (1)

Mathieu SOUM
Mathieu SOUM on 21 Jan 2016
Thanks to MATLAB support, I got things right.
So, to disable the generation of the report (and therefore the opening of the report window), you can simply use the command :
set_param(system, 'GenerateReport', 'Off')
I also got some more information from the MATLAB support. It is also possible to generate this report but prevent the window from opening using these commands :
set_param(system, 'GenerateReport', 'On')
set_param(system, 'LaunchReport', 'Off')
I was using MATLAB R2011a. But since R2012, there are some dedicated methods to open/close code report :
coder.report.open
coder.report.close()

Community Treasure Hunt

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

Start Hunting!