MATLAB Community

MATLAB, community & more

Seeing also

Quan recently commented that he uses the “see also” part of M-file help as a way of finding related functions.

This made me think back to my early days writing MATLAB code, where my TA would take off points for not including help comments at the top of every M-file. Including a See Also is a nice way to build a graph of related functions, and it helps your users understand the relationship between files. I use it most when trying to find an exact function in a related family of functions, usually from one of the string or matrix manipulation functions.

We started out just by adding the See Also for related functions in the M-file help, as you can see in the following MATLAB 5.0 help for findstr.

FINDSTR HELP: v5

By the time we got to MATLAB R2008a, the findstr doc was expanded a bit, and the functions in the see also were hyperlinks to their respective functions.

FINDSTR HELP: R2008a

When you write your own M-files, you too can get the hyperlinks for free. Just add a %see also function1, function2, etc... line to the help section of your script or function, and MATLAB takes care of the rest.

We also provide a Help Report that scans the M-files in a directory and will let you know if you missed any “see also” lines in your M-files.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.