Matlab is an interactive system for doing nu-merical computations.
A numerical analyst called Cleve Moler wrotethe ﬁrst version of Matlab in the 1970s. Ithas since evolved into a successful commercialsoftware package.
Matlab relieves you of a lot of the mundanetasks associated with solving problems nu-merically. This allows you to spend more timethinking, and encourages you to experiment.
Matlab makes use of highly respected algo-rithms and hence you can be conﬁdent aboutyour results.
Powerful operations can be performed using just one or two commands.
You can build up your own set of functionsfor a particular application.
Excellent graphics facilities are available, andthe pictures can be inserted into L
TEX andWord documents.These notes provide only a brief glimpse of thepower and ﬂexibility of the Matlab system. For amore comprehensive view we recommend the bookMatlab GuideD.J. Higham & N.J. HighamSIAM Philadelphia, 2000, ISBN: 0-89871-469-9.
2 Starting Up
2.1 Windows Systems
On Windows systems MATLAB is started by double-clicking the MATLAB icon on the desktop or byselecting MATLAB from the start menu.The starting procedure takes the user to the Com-mand window where the Command line is indicatedwith ’
’. Used in the calculator mode all Matlabcommands are entered to the command line fromthe keyboard.Matlab can be used in a number of diﬀerent ways ormodes; as an advanced calculator in the calculatormode, in a high level programming language modeand as a subroutine called from a C-program. Moreinformation on the ﬁrst two of these modes is givenbelow.Help and information on Matlab commands can befound in several ways,
from the command line by using the ’
’ command (see below),
from the separate Help window found underthe Help menu or
from the Matlab helpdesk stored on disk oron a CD-ROM.Another useful facility is to use the ’
’command, which searches the help ﬁles for the key-word. See Exercise 16.1 (page 17) for an exampleof its use.
2.2 Unix Systems
You should have a directory reserved for sav-ing ﬁles associated with Matlab. Create sucha directory (
) if you do not have one.Change into this directory (
Start up a new
Launch Matlab in one of the
windowswith the command
After a short pause, the logo will be shownfollowed by
is the Matlab prompt.Type
at any time
to exit from Mat-lab
2.3 Command Line Help
Help is available from the command line prompt.Type
for “help” (which gives a brief syn-opsis of the help system),
for a list of topics.The ﬁrst few lines of this read
HELP topics: matlab/general - General purpose commands. matlab/ops - Operators and special char... matlab/lang - Programming language const... matlab/elmat - Elementary matrices and ma... matlab/elfun - Elementary math functions. matlab/specfun - Specialized math functions.
(truncated lines are shown with ...). Then to ob-tain help on “Elementary math functions”, for instance,type
>> help elfun
This gives rather a lot of information so, in order to seethe information one screenful at a time, ﬁrst issue thecommand
>> more on>> help elfun
Hit any key to progress to the next page of information.