|
|
|
|
|
|
|
MATLAB (MATrix LABoratory) is a software package designed for
scientific and engineering numeric calculations. It is useful for
solving problems in applied linear algebra, general purpose numeric
computation, algorithm prototyping, and special purpose problems with
matrix formulations that arise in fields such as automatic control
theory, statistics and digital signal processing. It also has graphics
capabilities, including generation of files for the Calcomp plotter and
laser printers. You can use MATLAB interactively or in batch mode.
In order to use MATLAB, you must define its symbols and logical names.
To do this, type SETUP MATLAB at the DCL $ prompt. It will be necessary
to do this each time you log into the VAX and want to use MATLAB. If
you wish, you can put the SETUP MATLAB command in your login.com file
so that it will be executed automatically each time you log in.
In order to invoke MATLAB, type MATLAB at the $ prompt. The MATLAB >>
prompt will appear. Once you are inside MATLAB, you can type HELP for
more information. There is also a demo available which can be run by
typing DEMO at the >> prompt. To exit MATLAB, type QUIT at the >>
prompt. Note that MATLAB is case-sensitive; e.g. 'QUIT' is not the
same as 'quit'. Here is a sample MATLAB session:
(c) Copyright The MathWorks, Inc. 1984-1991
All Rights Reserved
Version 3.5g Mar 19 1991
HELP, DEMO, INFO, and TERMINAL are available
>> A = [1 2 3;4 5 6;7 8 0]
A =
1 2 3
4 5 6
7 8 0
>> det(A)
ans =
27
>> quit
Rather than type a series of commands at the >> prompt, you can, if you
wish, use a text editor to create a program containing the commands you
want to invoke. Your program must use the extension M. Then, once you
have invoked MATLAB, you can run the program by typing its name
(without the extension) at the >> prompt. The resulting output will
appear on the terminal screen.
As an example, a program to produce the same output as the sample
MATLAB session on the previous page, named simple.m, would look like
this:
You would then type the word SIMPLE at the MATLAB >> prompt to generate
your output.
You can alternatively submit your MATLAB program as a batch job. In
order to do so, you need to create a command procedure in addition to
your program. The command procedure should be given the extension COM.
You then submit your command procedure to a batch queue using the
SUBMIT command:
submit/noprint/notify/que=QUENAME FILENAME
where QUENAME is either express, batch10, batch30 or batch60, and
FILENAME is the name of your command procedure without the extension.
When the job is completed, you can inspect the LOG and LIS files for
errors and program output.
As an example, if you wanted to submit the MATLAB program SIMPLE.M as a
batch job, you might create the following command file (which we'll
give the name CALC.COM):
This command file 1) sets up MATLAB symbols (unnecessary if this line
is already in your LOGIN.COM file) 2) changes the default directory to
one containing your matlab programs - use your username for USER and
the appropriate subdirectory name for DIRECTORY 3) instructs the VAX to
look for the input program in SIMPLE.M and place the output in
SIMPLE.LIS and 4) run matlab. You would then type the following command
at the $ prompt:
submit/noprint/notify/que=express calc
The resulting output would be found in CALC.LOG and CALC.LIS.
For more information about using MATLAB, consult the following manuals
available in 313A Clement Hall: "PRO-MATLAB User's Guide", "Control
Toolbox User's Guide", "ROBUST-CONTROL TOOLBOX User's Guide." See also
the handout "MATLAB and Graphics" available from Dr. Paul Tsai in 310
Clement Hall.
Setting Up MATLAB
Using MATLAB Interactively
$ matlab
A = [1 2 3;4 5 6;7 8 0]
det(A)
Using MATLAB in Batch Mode
$ setup matlab
$ set default [USER.DIRECTORY]
$ assign simple.m sys$input
$ assign simple.lis sys$output
$ matlab
For More Help
This page maintained by: Jim Johnson
For additional information, contact Paul Tsai, PTsai@tntech.edu
Last updated: December 14, 1998