{"id":13482,"date":"2021-08-06T09:00:53","date_gmt":"2021-08-06T13:00:53","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=13482"},"modified":"2021-10-04T16:58:17","modified_gmt":"2021-10-04T20:58:17","slug":"m2uml","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2021\/08\/06\/m2uml\/","title":{"rendered":"m2uml"},"content":{"rendered":"&nbsp;\r\n<div class=\"rtcContent\">\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>'s pick this week is <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59722\">m2uml<\/a> by <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1670\">per isakson<\/a>.<\/div>\r\n<div style=\"margin-bottom: 20px; padding-bottom: 4px;\">\r\n<div style=\"margin: 0px; padding: 10px 0px 10px 5px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: start;\"><span style=\"font-weight: bold;\">Table of Contents<\/span><\/div>\r\n<div style=\"margin: -1px 0px 0px; padding: 10px 0px 10px 7px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: start;\"><a href=\"#H_155D655E\">m2uml\r\n<\/a><a href=\"#H_EF470106\">MATLAB's Class Diagram Viewer in R2021a\r\n<\/a><a href=\"#H_F97CD63B\">Comments<\/a><\/div>\r\n<\/div>\r\n<h2 id=\"H_155D655E\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #3c3c3c; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">m2uml<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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:<\/div>\r\n<div style=\"background-color: #f7f7f7; margin: 10px 0 10px 0;\">\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 1px solid #e9e9e9; border-bottom: 0px none #000000; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">list = {<span style=\"color: #a020f0;\">'Content.Applicator'<\/span>,<span style=\"color: #a020f0;\">'Content.FileSet'<\/span>,<span style=\"color: #a020f0;\">'Content.Selectors.Selector'<\/span>,<span style=\"color: #a020f0;\">'Content.Selectors.All'<\/span>, <span style=\"color: #0000ff;\">...<\/span><\/span><\/div>\r\n<\/div>\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 0px none #000000; border-bottom: 0px none #000000; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> <span style=\"color: #a020f0;\">'Content.Selectors.ExcludeXML'<\/span>, <span style=\"color: #a020f0;\">'Content.Selectors.Extension'<\/span>, <span style=\"color: #a020f0;\">'Content.Selectors.File'<\/span>, <span style=\"color: #0000ff;\">...<\/span><\/span><\/div>\r\n<\/div>\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 0px none #000000; border-bottom: 0px none #000000; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> <span style=\"color: #a020f0;\">'Content.Selectors.Folder'<\/span>, <span style=\"color: #a020f0;\">'Content.Selectors.Git'<\/span>, <span style=\"color: #a020f0;\">'Content.Selectors.All'<\/span>, <span style=\"color: #a020f0;\">'Content.Converters.Converter'<\/span>, <span style=\"color: #0000ff;\">...<\/span><\/span><\/div>\r\n<\/div>\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 0px none #000000; border-bottom: 0px none #000000; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> <span style=\"color: #a020f0;\">'Content.Converters.FilesToZip'<\/span>, <span style=\"color: #a020f0;\">'Content.Converters.HTMLToWord'<\/span>, <span style=\"color: #a020f0;\">'Content.Converters.MarkdownToHTML'<\/span>, <span style=\"color: #0000ff;\">...<\/span><\/span><\/div>\r\n<\/div>\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 0px none #000000; border-bottom: 0px none #000000; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> <span style=\"color: #a020f0;\">'Content.Converters.PowerPointToPDF'<\/span>, <span style=\"color: #a020f0;\">'Content.Converters.SimulinkToWebview'<\/span>}.';<\/span><\/div>\r\n<\/div>\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; border-top: 0px none #000000; border-bottom: 1px solid #e9e9e9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">m2uml.create_PlantUML_script(<span style=\"color: #a020f0;\">'Classes'<\/span>, list);<\/span><\/div>\r\n<\/div>\r\n<\/div>\r\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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).<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 808px; height: 519px;\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/mainm2uml_01.png\" alt=\"2021-08-05_08-12-24.png\" width=\"808\" height=\"519\" \/><\/div>\r\n<h2 id=\"H_EF470106\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #3c3c3c; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">MATLAB's Class Diagram Viewer in R2021a<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Starting in MATLAB R2021a, MATLAB has a native <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.diagram.classviewer-class.html\">class diagram viewer<\/a>. 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.<\/div>\r\n<div style=\"background-color: #f7f7f7; margin: 10px 0 10px 0;\">\r\n<div class=\"inlineWrapper\">\r\n<div style=\"border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: #000000; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #e9e9e9;\"><span style=\"white-space: pre;\">matlab.diagram.ClassViewer(<span style=\"color: #a020f0;\">\"Packages\"<\/span>, <span style=\"color: #a020f0;\">\"Content\"<\/span>)<\/span><\/div>\r\n<\/div>\r\n<\/div>\r\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 801px; height: 417px;\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/mainm2uml_02.png\" alt=\"2021-08-05_08-21-56.png\" width=\"801\" height=\"417\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 0px; height: 0px;\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/mainm2uml_03.png\" alt=\"\" width=\"0\" height=\"0\" \/><\/div>\r\n<h2 id=\"H_F97CD63B\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #3c3c3c; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Comments<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #000000; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Have you wanted to visualize classes in MATLAB? Now you have two ways to do it! Give these a try and let us know what you think <a href=\"#respond\">here<\/a> or leave a <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59722\">comment<\/a> for per.<\/div>\r\n<\/div>\r\n&nbsp;","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/pick\/files\/mainm2uml_03.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>&nbsp;\r\n\r\nSean's pick this week is m2uml by per isakson.\r\n\r\nTable of Contents\r\nm2uml\r\nMATLAB's Class Diagram Viewer in R2021a\r\nComments\r\n\r\nm2uml\r\nHave you ever had (or inherited!) a lot of classes... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2021\/08\/06\/m2uml\/\">read more >><\/a><\/p>","protected":false},"author":87,"featured_media":13479,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/13482"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=13482"}],"version-history":[{"count":7,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/13482\/revisions"}],"predecessor-version":[{"id":14301,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/13482\/revisions\/14301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media\/13479"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=13482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=13482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=13482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}