Programming and Data Types    


This section covers the following topics:

Using the Help Browser

Open the Help Browser from the MATLAB Command Window using one of the following means:

Some of the features of the Help Browser are listed below.

Product Filter
Establish which products to find help on
Look up topics in the Table of Contents
Look up help using the documentation Index
Search the documentation for one or more words
See what demos are available; run selected demos
Save bookmarks for frequently used Help pages

For more information: See Finding Information with the Help Browser in the MATLAB "Development Environment" documentation

Help on Functions from the Help Browser

To find help on any function from the Help Browser, do either of the following:

Help on Functions from the Command Window

Several types of help on functions are available from the Command Window:

Topical Help

In addition to the help on individual functions, you can get help on any of the following topics by typing help <topicname> at the command line.

Topic Name
Arithmetic operators
Relational and logical operators
Special character operators
Arithmetic division operators
Parentheses, braces, and bracket operators
Operator precedence
Comma separated lists
Character strings
Function handles and the @ operator
Debugging functions
Using Java from within MATLAB
A list of readable file formats
Windows directory change notification

Paged Output

Before displaying a lengthy section of help text or code, put MATLAB into its paged output mode by typing more on. This breaks up any ensuing display into pages for easier viewing. Turn off paged output with more off.

Page through the displayed text using the space bar key. Or step through line by line using Enter or Return. Discontinue the display by pressing the Q key or Ctrl+C.

Writing Your Own Help

Start each program you write with a section of text providing help on how and when to use the function. If formatted properly, the MATLAB help function displays this text when you enter

MATLAB considers the first group of consecutive lines immediately following the function definition line that begin with % to be the help section for the function. The first line without % as the left-most character ends the help.

For more information: See Help Text in the MATLAB "Development Environment" documentation

Help for Subfunctions and Private Functions

You can write help for subfunctions using the same rules that apply to main functions. To display the help for the subfunction mysubfun in file myfun.m, type:

To display the help for a private function, precede the function name with private/. To get help on private function myprivfun, type:

Help for Methods and Overloaded Functions

You can write help text for object-oriented class methods implemented with M-files. Display help for the method by typing

where the file methodname.m resides in subdirectory @classname.

For example, if you write a plot method for a class named polynom, (where the plot method is defined in the file @polynom/plot.m), you can display this help by typing

You can get help on overloaded MATLAB functions in the same way. To display the help text for the eq function as implemented in matlab/iofun/@serial, type

  Command and Function Syntax Development Environment