Contenido principal

MATLAB Design Information

R2026b
Since R2026b

Metric 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 decisions

  • InterfacePorts — Structure with fields:

    • In — Number of input arguments

    • Out — Number of output arguments

  • ELOC — Number of effective lines of MATLAB code

  • Halstead — Structure with fields:

    • TotalOperands — Number of MATLAB operands

    • TotalOperators — Number of MATLAB operators

    • UniqueOperands — Number of unique MATLAB operands

    • UniqueOperators — Number of unique MATLAB operators

    • Volume — Size of the design layer

    • Difficulty — Estimate of how difficult the design layer is to read and write

See Also

Objects

Functions

Topics