Can I reduce the size of Model_data.c file generated by Embdded Coder?

4 views (last 30 days)
When generate C/C++ code with Embdded Coder, output of some block in some Toolbox has Model_data.c file more than 100 Mb
Can I reduce Model_data.c file size by changing some configuration in Simulink?

Answers (1)

Pratyush Swain
Pratyush Swain on 27 Nov 2023
Hi 재욱 임,
To reduce or optimize the size of the C file generated by Embedded Coder, consider the following strategies:
1-Split the generated files - Instruct the embedded coder to create multiple files as its output, rather than putting every function in the same C file.For more information please refer to https://www.mathworks.com/matlabcentral/answers/93591-can-i-separate-or-split-large-generated-files-into-smaller-files-created-by-simulink-coder-8-0-r201
2-Code Generation Settings - Adjust or modify the code generation settings to optimize the generated code. Plese refer https://www.mathworks.com/help/ecoder/ug/generating-code-using-embedded-coder.html
3-Subsystem Partitioning - If your model has large subsystems, consider partitioning them into smaller, more manageable subsystems.
Hope this helps.

Categories

Find more on Deployment, Integration, and Supported Hardware 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!