m2uml
Table of Contents
m2uml
Have you ever had (or inherited!) a lot of classes that you want to visualize in a graphical way to understand their relationships and capabilities? This submission takes a set of MATLAB classes and exports UML that can be visualized in various third party tools. I have a set of classes that I want to visualize, so I create the list and the UML:
list = {'Content.Applicator','Content.FileSet','Content.Selectors.Selector','Content.Selectors.All', ...
'Content.Selectors.ExcludeXML', 'Content.Selectors.Extension', 'Content.Selectors.File', ...
'Content.Selectors.Folder', 'Content.Selectors.Git', 'Content.Selectors.All', 'Content.Converters.Converter', ...
'Content.Converters.FilesToZip', 'Content.Converters.HTMLToWord', 'Content.Converters.MarkdownToHTML', ...
'Content.Converters.PowerPointToPDF', 'Content.Converters.SimulinkToWebview'}.';
m2uml.create_PlantUML_script('Classes', list);
This writes to a file whos contents I now pasted into a third party interpreter. The display shows me the class relationships, namespaces, as well as each method and property with icon-coded attributes. There are lots of new features in the most recent update, including full integrated documentation and nested packages (which is required for the below diagram).
![2021-08-05_08-12-24.png](https://blogs.mathworks.com/pick/files/mainm2uml_01.png)
MATLAB's Class Diagram Viewer in R2021a
Starting in MATLAB R2021a, MATLAB has a native class diagram viewer. You can either call this from the command line or open it from a project. This then lets you explore hierarchies, attributes, etc. of a set of classes natively in MATLAB.
matlab.diagram.ClassViewer("Packages", "Content")
![2021-08-05_08-21-56.png](https://blogs.mathworks.com/pick/files/mainm2uml_02.png)
![](https://blogs.mathworks.com/pick/files/mainm2uml_03.png)
Comments
- カテゴリ:
- Picks
コメント
コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。