Search code examples
matlabdocumentationsimulinkstateflow

What built-in options for documentation are there in MATLAB?


I'm looking for a way to document the code and models created or generated by MATLAB (m-files) Simulink models (S-functions etc.) and Stateflow. In the last five years I was using Octave so I'm not familiar with newer MATLAB features.

The documentation should be able to present mathematical functions as well as graphics and if possible have a help menu. Portability (html, pdf etc.) is also of interest.

What options are available in MATLAB R2017b and to what extent can they satisfy the above requirements? If there's no built-in tool, I want an external tool that can do this.

To what extent can MATLAB's Publish tool meet these requirements? Does it need a separate toolbox license?


Solution

  • I think that you should use Matlab Report generator

    Theres is a good quickstart also on matlab online documentation:

    https://es.mathworks.com/help/rptgen/ug/_mw_bf8ea6ab-5b87-44fd-a82e-c716ff17edd3.html

    As you said:

    The documentation should be able to present mathematical-functions as well as possible graphics and if possible have a help-menu. Portability (html, pdf etc. would also be of interest).
    
    • Automatically generates richly formatted reports from your MATLAB programs and applications
    • Generate reports in PDF, Microsoft® Word, Microsoft PowerPoint®, and HTML
    • Captures results and figures generated from your MATLAB code and presents them within a single report

    Also what you need to import is inside matlab:

    import mlreportgen.report.* 
    import mlreportgen.dom.*
    

    Ans as said, instead of reproduce what the getting started guides do, you should follow one:

    https://es.mathworks.com/help/rptgen/getting-started.html