

#MATLAB COMMENT NEW SCRIPT FILE CODE#
When your code is ready, you can export the result to HTML/PDF/XML, etc.
#MATLAB COMMENT NEW SCRIPT FILE FULL#
For a full reference, see Making Up MATLAB Comments for Publishing on the Mathworks website. There's a post by "Loren on the art of MATLAB" with a short introduction on publishing and markup. It seems MATLAB comments support some form of markup not so far from Markdown's syntax (as used on SO itself), with support for LaTeX equations and all. I've recently come to learn about matlab's built-in publishing system. If anyone finds the list of such supported titles, please link to it here! Īnd the See also part is formatted as a title, but if you replace See also by something else, it doesn't work. I figure there is some (see example), but I've never found the appropriate documentation. It would be nicer if there were a direct helptext hyperlink form. Unfortunately, since you need to put either "help" or "doc" in those hyperlinks, it only works in one or the other presentation form. You can use this to point to any function "function>subfunction" is just the syntax for addressing subfunctions in help() calls. In particular, you can use hyperlinks to invoke arbitrary Matlab commands, and point to other sections of helptext by having it invoke help(). You can use a limited form of hyperlinks in help. Method names are qualified I think names of methods in the same class as the current method can be unqualified.Įverything between the H1 line and "Examples:" is just a conventional formatting that I find readable help() doesn't treat it specially. Function names after "See also:" are all caps.I'm not sure which all cases work this one does for sure. The function name in the H1 line is all caps, regardless of actual capitalization of the function name in the signature.It needs to be just one line so it is properly picked up by contentsrpt(), which can autogenerate a Contents.m file from the helptext in your functions The first line after the function signature is called the "H1 line".% documentation on obscure features and options, and so on.Įrror('This is a placeholder function just for helptext')

% Here is where you would put additional examples, technical discussions,

%EXTENDED_HELP Some additional technical details and examples % a single screen, and then break out obscure parts to separate sections. % It's broken out like this so you can keep the main "help foo" text on % More detailed help is in the extended_help">extended help. % and choose "Wrap selected comments" to re-flow the text. In the editor, you can highlight paragraphs, right-click, It's treated as preformatted text help() and doc() will not % Multi-line paragraphs of descriptive text go here. Here's the helptext formatting I've picked up on and found useful. This describes both simple helptext and generating separate HTML help files. MATLAB > User's Guide > Desktop Tools and Development Environment > Customizing Help and Demos > Providing Your Own Help and Demos. Try this other section in the official documentation.
