MATLAB Classes in Code Generation Reports

What Reports Tell You About Classes

Code generation reports:

  • Provide a hierarchical tree of the classes used in your MATLAB® code.

  • Display a list of methods for each class in the MATLAB code tab.

  • Display the objects used in your MATLAB code together with their properties on the Variables tab.

  • Provide a filter so that you can sort methods by class, size, and complexity.

  • List the set of calls from and to the selected method in the Calls list.

How Classes Appear in Code Generation Reports

In the MATLAB Code Tab

The report displays an alphabetical hierarchical list of the classes used in the your MATLAB code. For each class, you can:

  • Expand the class information to view the class methods.

  • View a class method by clicking its name. The report displays the methods in the context of the full class definition.

  • Filter the methods by size, complexity, and class by using the Filter functions and methods option.

Default Constructors.  If a class has a default constructor, the report displays the constructor in italics.

Specializations.   If the same class is specialized into multiple different classes, the report differentiates the specializations by grouping each one under a single node in the tree. The report associates the class definition functions and static methods with the primary node. It associates the instance-specific methods with the corresponding specialized node.

For example, consider a base class, Shape that has two specialized subclasses, Rhombus and Square. The Shape class has an abstract method, getarea, and a static method, distanceBetweenShapes. The code generation report, displays a node for the specialized Rhombus and Square classes with their constructors and getarea method. It displays a node for the Shape class and its associated static method, distanceBetweenShapes, and two instances of the Shape class, Shape1 and Shape2.

Packages.  If you define classes as part of a package, the report displays the package in the list of classes. You can expand the package to view the classes that it contains. For more information about packages, see Packages Create Namespaces.

In the Variables Tab

The report displays the objects in the selected function or class. By default, for classes that have properties, the list of properties is collapsed. To expand the list, click the + symbol next to the object name. Within the list of properties, the list of inherited properties is collapsed. To expand the list of inherited properties, click the + symbol next to Inherited.

The report displays the properties using just the base property name, not the fully qualified name. For example, if your code uses variable obj1 that is a MATLAB object with property prop1, then the report displays the property as prop1 not obj1.prop1. When you sort the Variables column, the sort order is based on the fully qualified property name.

In the Call Stack

The call stack lists the functions and methods in the order that the top-level function calls them. It also lists the local functions that each function calls.

Was this topic helpful?