Finding Your Way Around the Window


The Command Window

The Command window is where you can interact with Matlab directly. Try typing the following:
foo = ones(2)
The output should look like this:

foo =

       1       1
       1       1

This represents a 2x2 matrix of ones. Matlab inserts extra blank lines between practically everything. To turn off this feature, type
format compact

Unlike Maple and Mathematica, previous input lines cannot be edited. You can recall previous input lines by typing the "up" cursor button. If your type some text before hitting the "up" cursor button, Matlab will recall lines matching the text you've type so far.

Cutting, copying and pasting is supported using the standards for your operating system.


The Toolbar

Systems that support graphics have a toolbar at the top of the screen, like this:
Matlab Toolbar on NT
The buttons have the following functions:
Matlab Toolbar on NT - File commands New File, Open File
Matlab Toolbar on NT - Edit Cut, Copy, and Paste
Matlab Toolbar on NT - Undo Undo last action
Matlab Toolbar on NT - Workspace Browser Workspace Browser. Use this to graphically edit variables.
Matlab Toolbar on NT - Path Browser Path browser. Use this to edit the paths that Matlab will look in for functions.
Matlab Toolbar on NT - Simulink Library Simulink Library Browser (not covered in this tutorial).
Matlab Toolbar on NT - Help Open help window.

The Help System

Built-in Help
If you know the name of a Matlab function you need help with, type
help function-name
to see the help text contained in the function definition itself. If you don't know the name of the function you need, try lookfor keyword . Matlab then searches through the first line of help text of each function for the keyword. However, the search is very slow, and often deluges the user with many items. In addition, a search for a concept, such as "matrix" will almost never return what you need.

HTML Help
A more useful (but more difficult to access) set of help files is included in HTML. To access it, choose Help->Help Desk, or type helpdesk .
This will launch a Java-based web browser and open a web page. This process may fail on some Unix systems. Lynx users may wish to avoid it altogether.

While the content is essentially the same as the built-in help, it is presented in a more user-friendly format. The Java-based full-text search and index-by-subject are two extremely useful features. In addition, the entire set of printed manuals is available as Adobe PDF documents.

tip arrow Most of the help files list function names in all capital letters for emphasis.
However, all built-in matlab functions are in small letters.

Next: Matlab Syntax
Previous: Introduction