0

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?

buzjwa
  • 2,632
  • 2
  • 24
  • 37
Medi1Saif
  • 285
  • 7
  • 19
  • 2
    You can make your functions self-documenting using the template structure given to you upon creating a new function, see [here](https://uk.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html), or read the [Displaying Custom Documentation](https://uk.mathworks.com/help/matlab/matlab_prog/display-custom-documentation.html) page – Wolfie Feb 20 '18 at 08:05

1 Answers1

2

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

anquegi
  • 11,125
  • 4
  • 51
  • 67