MATLAB Design Information
R2026bMetric ID
mldesignlayer.MATLABDesignInfo
Description
This metric summarizes design information for MATLAB® code. The metric combines multiple MATLAB design metrics into a single result to help you assess the size, architecture, and complexity of your MATLAB code.
For each MATLAB design layer, the metric returns the:
Number of decisions
Number of interface ports
Effective lines of code (eLOC)
Halstead complexity metrics
A MATLAB design layer is an artifact, such as a MATLAB function or method, that you implement using MATLAB code.
Supported Artifacts
You can collect this metric for Units and Components. To control what the dashboard classifies as a unit or component, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric combines metric data from these individual metrics:
Collection
To collect data for this metric, execute the metric engine using the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"mldesignlayer.MATLABDesignInfo")Results
The metric returns results for each MATLAB design layer in the units and components in your project. For each design layer,
the metric returns a metric.Result object.
The Value property is a structure with these fields:
Decisions— Number of decisionsInterfacePorts— Structure with fields:In— Number of input argumentsOut— Number of output arguments
ELOC— Number of effective lines of MATLAB codeHalstead— Structure with fields:TotalOperands— Number of MATLAB operandsTotalOperators— Number of MATLAB operatorsUniqueOperands— Number of unique MATLAB operandsUniqueOperators— Number of unique MATLAB operatorsVolume— Size of the design layerDifficulty— Estimate of how difficult the design layer is to read and write