How to keep only the header and source files after code generation ?

25 views (last 30 days)
Hello ,
For the project I'm working on, I generate code for multiple model reference and I do the integration on a multicore board on an IDE? once i generate the code i have a lot of unneceessary files in the code generated folder.
Can this be optimised ? how can i tell simulink to only generate header and source files?
to be more clear i want to go from image A to Image B automaticaly.
Thank you !

Answers (1)

Yash
Yash on 16 Nov 2024 at 14:38
As far as I am aware there isn't a way to disallow code generation for files of a certain file type. You can use a custom script to delete unnecessary files of given type(s) by using the delete function:
delete *.mat
The above command deletes all files of type ".mat" in the current directory. You can do the same for other file types.
To optimize code generation, you might want to explore the settings available under "Code Generation > Optimization" and "Code Generation > Interface" in the Configuration Parameters. Note that by default Simulink Coder uses incremental code generation and incremental loading while generating code for model reference hierarchy [https://www.mathworks.com/help/releases/R2021b/rtw/ug/generate-code-for-model-reference-hierarchy.html]
Refer to these documentation for futher reading:

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!