Collect Design Cost Metrics
Use design cost metrics to estimate the cost of implementing your Simulink® design in embedded C code. Design cost metrics analyze your model and report detailed cost data that can be traced back to the blocks in the Simulink model.
metric.Engine to collect metric data on the memory usage of one or more design units in a project. Analyze design cost using these metrics:
Data segment estimate — Estimate the amount of memory consumed, in bytes, by the data segment of code generated for the specified model unit. A data segment is a part of an object file or the corresponding address space of a program that holds initialized global variables and static local variables used during code generation. The size of the data segment is determined by the size of the values in the source code and does not change at run time.
Operator count — Use a weighted count of operators in the generated code to estimate the size of your program. This metric is an abstraction of the actual size of generated code, and is returned as a unitless value.
You can use design cost metrics to identify cost bottlenecks, compare multiple design alternatives in a trade study, or track design growth following a change.