Class Diagram Viewer
Description
The Class Diagram Viewer app enables you to create class diagrams that show implementation details and hierarchies. You can use this app to explore class structures and share class diagrams with others. These diagrams can include details about:
The internal structure of classes, including properties and methods and their access attributes
The hierarchy of classes, including packages, with inheritance relationships shown graphically
You can create class diagrams using the graphical interface or the command line API
defined by matlab.diagram.ClassViewer
.
Open the Class Diagram Viewer
MATLAB® command prompt:
matlab.diagram.ClassViewer
MATLAB toolstrip: On the Apps tab, under MATLAB, click the app icon.
Current Folder browser: Right-click on a class file or a folder that contains one or more class files and select
View Class Diagram
.On the Project tab, click the app icon
Examples
Programmatic Use
Tips
Class Diagram Viewers are instances of the
matlab.diagram.ClassViewer
class. Use the class constructors to open more than one viewer at a time.When the
button appears on an arrow between two classes, rather than on a class card itself, there are additional classes in the hierarchy between the two connected classes. Click the
button to add all of the viewable classes in that part of the hierarchy.
If you make changes to the class code while using the Class Diagram Viewer, you can automatically update the diagram by clicking Refresh.
Version History
Introduced in R2021a