help - Help for functions in Command Window

GUI Alternatives

Use the Function Browser by clicking its button, , or run doc functionname to view more extensive help for a function in the Help browser.

Syntax

help
help /
help functionname
help modelname.mdl
help toolboxname
help toolboxname/functionname
help classname.methodname
help classname
help syntax
t = help('topic')

Description

help lists all primary help topics in the Command Window. Each main help topic corresponds to a directory name on the search path the MATLAB software uses.

help / lists all operators and special characters, along with their descriptions.

help functionname displays M-file help, which is a brief description and the syntax for functionname, in the Command Window. The output includes a link to doc functionname, which displays the reference page in the Help browser, often providing additional information. Output also includes see also links, which display help in the Command Window for related functions. If functionname is overloaded, that is, appears in multiple directories on the search path, help displays the M-file help for the first functionname found on the search path, and displays a hyperlinked list of the overloaded functions and their directories. If functionname is also the name of a toolbox, help also displays a list of subdirectories and hyperlinked list of functions in the toolbox, as defined in the Contents.m file for the toolbox.

help modelname.mdl displays the complete description for the MDL-file modelname as defined in Model Properties > Description. If the Simulink product is installed, you do not need to specify the .mdl extension.

help toolboxname displays the Contents.m file for the specified directory named toolboxname, where Contents.m contains a list and corresponding description of M-files in toolboxname. It is not necessary to give the full pathname of the directory; the last component, or the last several components, are sufficient. If toolboxname is also a function name, help also displays the M-file help for the function toolboxname.

help toolboxname/functionname displays the M-file help for the functionname that resides in the toolboxname directory. Use this form to get direct help for an overloaded function.

help classname.methodname displays help for the method methodname of the fully qualified class classname. If you do not know the fully qualified class for the method, use class(obj), where methodname is of the same class as the object obj.

help classname displays help for the fully qualified class classname.

help syntax displays M-file help describing the syntax used in MATLAB functions.

t = help('topic') returns the help text for topic as a string, with each line separated by /n, where topic is any allowable argument for help.

Remarks

Prevent Scrolling of Long Help Pages

To prevent long descriptions from scrolling off the screen before you have time to read them, enter more on, and then enter the help statement.

How the help Function Works

The help function lists all help topics by displaying the first line (the H1 line) of the contents files in each directory on the search path MATLAB uses. The contents files are the M-files named Contents.m within each directory.

Typing helptopic , where topic is a directory name, displays the comment lines in the Contents.m file located in that directory. If a contents file does not exist, help displays the H1 lines of all the files in the directory.

Typing help topic, where topic is a function name, displays help for the function by listing the first contiguous comment lines in the M-file topic.m.

Help for User-Created M-Files

You can provide help information for your own M-files, so that you and others can view it using the help function. You can also provide Contents.m files for files you create. If you provide help in class definition files for classes you create, the doc function displays the M-file help in the Help browser. For more information, see Help for the Files You and Other Users Create.

Examples

help close displays help for the close function.

help database/close displays help for the close function in the Database Toolbox™ product.

help datafeed displays help for the Datafeed Toolbox™ product.

help database lists the functions in the Database Toolbox product and displays help for the database function, because there are a function and a toolbox called database.

help general lists all functions in the directory matlabroot/toolbox/matlab/general. This illustrates how to specify a relative partial pathname rather than a full pathname.

help f14_dap displays the description of the Simulink f14_dap.mdl model file (the Simulink product must be installed).

t = help('close') gets help for the function close and stores it as a string in t.

See Also

class, doc, docsearch, helpbrowser, helpwin, lookfor, more, partialpath, path, what, which, whos

Related topics in the MATLAB Desktop Tools and Development Environment documentation:

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS