Documentation

doc

Reference page in Help browser

Syntax

Description

doc opens the Help browser. If the Help browser is already open, but not visible, then doc brings it to the foreground and opens a new tab.

example

doc name displays documentation for the functionality specified by name, such as a function, class, or block.

  • If there is a MathWorks® reference page corresponding to name, then doc displays the page in the Help browser. The doc command does not display third-party or custom HTML documentation.

  • If there is no reference page corresponding to name, then doc searches for help text in a file named name.m. When help text is available, doc displays it in the Help browser.

  • If there is no reference page and no help text associated with name, then doc searches the documentation for name and displays the search results in the Help browser.

Examples

expand all

Function Reference Pages

Display the reference page for the abs function.

doc abs

Several products include different versions of abs. If your Help preferences support displaying documentation for those products, then the Help browser displays the MATLAB® abs reference page and a message with links to other versions of abs. This message appears at the top of the page.

Class and Method Reference Pages

Display the reference page for the handle class.

doc handle

Display the reference page for the findobj method in the handle class.

doc handle.findobj

Display the reference page for the Map class in the containers package.

doc containers.Map

Custom Class Pages

Display formatted help text for a custom class.

MATLAB includes a set of example files that show how to create a class, including a class file named sads.m. Add the example folder to the path, and request documentation for sads.

addpath(...
   fullfile(matlabroot,'help','techdoc','matlab_env',...
   'examples'))
doc sads

Display the help for the steer method of the sads class.

doc sads.steer

Because the help text follows MATLAB conventions, MATLAB formats the display in the browser.

Input Arguments

expand all

name — Name of function, class, block, or other functionalitystring

Name of a function, class, block, or other functionality, specified as a string. Alternatively, an operator symbol.

Some classes and other packaged items require that you specify the package name. Events, properties, and some methods require that you specify the class name. Separate the components of the name with periods, such as:

doc className.name
doc packageName.name
doc packageName.className.name

Methods for some classes are not accessible using the doc command; instead, use links on the class reference page.

More About

expand all

Tips

  • To access third-party or custom documentation, open the Help browser and navigate to the documentation home page. Then, at the bottom of the page, click Supplemental Software.

See Also

|

Was this topic helpful?