MATLAB Lesson 0 - Using MATLAB

Getting Help

There are several ways of getting help within MATLAB. It is essential you become familiar with both the MATLAB help command and the MATLAB Help browser which has extensive documentation. MATLAB also contains a number of demonstration videos that can help you become familiar with it.

Help command

The quick way to get information about a MATLAB command is to type

help command_name

in the MATLAB command window. This may produce more information that will fit in one screen so you will have to scroll back to the beginning of the output.

Use the help command to find out more information about the help command.

This displays the help text for the specified command (help) in the command window.

>>  help help

Help menu

More extensive information about MATLAB and its commands is available through the Help Browser using a web based interface. This can be accessed in a number of ways.

You can type the term or command you want information about in the search box in the top right hand corner of the MATLAB window.

Alternatively you can left click the ? symbol in the small circle, just to the left of the search box (see the image in the previous module). This opens a new window like the one below.

MATLAB help window


Note there are many specialised toolboxes available as part of the UNSW MATLAB licence, some of which you may use in later courses (for example the statistics, optimization and symbolic math toolboxes).

Doc command

More specific information on a command can be accessed by typing

doc command_name

in the MATLAB Command Window. This is also available as a link at the end of the output from the help command or by searching in the help browser.
Use the Help Browser to find out information about the sqrt command.

This opens the Help Browser on the information for the sqrt command.

>>  doc sqrt



Self-test Exercise

Find out information about the MATLAB function exp.

Answer:
In the MATLAB command window type either
help exp
doc exp
Use the mouse to select the text between the word "Answer" and here to see the answer.

Summary

MATLAB includes extensive facilities for getting help.

The simplest way is to type
help command_name
in the MATLAB command window.

The Help Browser is accessed through the Help menu, the ? Help icon, or by typing
doc command_name
in the MATLAB command window.