Ever wanted a class dependency diagram and documentation of your MATLAB Classes. How about leveraging Doxygen to document your development project?
Fabrice provides a simple interface to make this possible. Interestingly enough, this entry doesn't actually contain MATLAB Code!
Do you want to know how MATLAB Classes are related?
The above image shows a subset of the class hierarchy for a project I have been working on, which I was able to generate using Fabrice's tool.
The diagram depicts each class in a box. The arrow points to the parent class from which each class is inherited.
The terminus for the dependency path is a built-in class in MATLAB, which in this case is "handle".
If you use comments in MATLAB Code to document your functions and classes, then you need to apply Fabrice's extra convention of "%>" instead of just "%" to determine which comments get parsed by Doxygen.
In addition Doxygen convention is the documentation for a function by default comes before the function, which the convention in MATLAB is that it comes after the function. To make sure your documentation is available in Doxygen and using the MATLAB DOC function, then you likely want to consider using the "<" flag in your first comment after a MATLAB Function or class parameter definition.
I did make a quick modification of the Perl script in Fabrice's entry to automate that process so that "%>" was replaced by "///<" and make the assumption that MATLAB Documentation always comes after the function or parameter definition.
You can use comments in your MATLAB code to generate documentation without any additional work. However it doesn't provide much in the way of developing dependency graphs.
- Do you use Doxygen to document your software development projects?
- Should this be a capability built into MATLAB or Simulink?
- What about generated C or HDL-code?
- Do you use a different method for using Doxygen with MATLAB?
Let us know here.
Get the MATLAB code
Published with MATLAB® 8.6
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.