MATLAB Basics
Description
MATLAB, which stands for MATrix LABoratory, is a powerful, general-purpose system or environment for doing mathematics. MATLAB is an interactive system whose basic data is a matrix that does not require dimensioning. It supports many types of graph and surface plots: line plots (x vs. y), filled plots, bar charts, pie charts, parametric plots, polar plots, contour plots, density plots, log axis plots, surface plots, parametric plots in 3 dimensions and spherical plots. Users can add error bars to plots, modify axis labeling and animate a sequence of plots.
Highlights: MATLAB has a command-line interface and users must learn the syntax and general use of this interface and package. However, the syntax is fairly straightforward and minimal -- especially if you rely on default options.
Availability and Setup
MATLAB is a "High-Performance Numeric Computation and Visualization Software" package. MATLAB is available on all SCV supported systems. To allow for graphical output, MATLAB should be invoked under the X Window System on X terminals or workstations. To do this, you must first set your DISPLAY environment variable to allow you to run this X Application and allow it to display graphics on your local machine/terminal. You may also want to set the environment variable TERM to be xterm
To invoke MATLAB, type: matlab at the shell prompt. You can exit MATLAB by typing exit or quit at the MATLAB prompt.
In general, we recommend that you use MATLAB on the
SCV Linux Cluster. Since MATLAB is no longer in development
for the AIX pSeries machines, the only working version is MATLAB 5.3.1.
Using MATLAB
MATLAB has a command line interface similar to mathematica and gnuplot as well as the ability to save scripts to files for later execution. Plots are of good quality and there are an extensive array of functions organized into toolboxes.
The MATLAB Reference Guide lists the primary MATLAB functions in alphabetical order with each command described by purpose, synopsis, description, examples and related commands. For a basic introduction to MATLAB, consider following the Tutorial in Chapter 2 of the MATLAB User's Guide.
Running MATLAB under the Batch System on the IBM pSeries (click here for instructions on the Linux Cluster):
- Create a script, say, "mbatch", that contains the line:
#!/bin/csh nohup matlab -display null < $1 >! $2
On systems that runs MATLAB 6 or 7, you could use the following script:
#!/bin/csh nohup matlab -nodisplay < $1 >! $2
Without the "!", output will not be permitted if the output file already exists.
- type chmod +x mbatch
- Insert "exit" at the end of your m-file.
- To run this file, issue the following command at the system prompt:
% mbatch infile outfile
The above runs the job in the background. Infile is your m-file. outfile is the output file name. Note that Infile must include the suffix .m.
- To run batch:
% bsub -q queue-name "mbatch infile outfile"
In the above, queue-name is the queue name.
You can find out about queue-name by typing, at prompt:
% bqueues -l
and find out the status of your jobs:
% bjobs
- Run MATLAB without a license:
If you can't run your MATLAB applications because no MATLAB
license is available, here is a work-around.
- Run MATLAB in parallel:
If you need to solve large, real, linear system of equations within the MATLAB environment but would like to take advantage of the powers of the multi-processor IBM p690 or IBM p655 systems, you can now use an m-file developed at BU called parallel_lu.m which makes use of LAPACK's LU decomposition linear system solver.
This m-file calls an external program which in turn calls SGI/Cray parallel math library. To use this, you need to do the following:
- create a "matlab" directory under your home dir (if it does not already exist).
- In this directory, create a file called "startup.m" which has the following line in it:
addpath /usr/local/examples/matlab/parallel_tools
- Run matlab
-
>> help parallel_lu will give you a description of input/output parameters.
- An example, called lu_example.m has been set up and lives in /usr/local/examples/matlab/parallel_tools; you can run it
>> lu_example
Please e-mail Kadin Tseng (kadin@bu.edu) if you have problems or suggestions regarding this m-file.
Additional Help/Documentation
We also have an Introduction to MATLAB Tutorial available with more indepth information on using MATLAB.
What hardcopy documentation we have is available in the Computer Graphics Lab (Room 203, 111 Cummington Street, lab hours and access). This includes a complete set of manuals for versions 5 and 6, including both Getting Started with MATLAB and Using MATLAB.
Online, you may want to visit the site of MathWorks, Inc. the producers of MATLAB and you can get help from within MATLAB using the command help.
Document Name: matlab
Author/Maintainer: Aaron D. Fuegi (aarondf@bu.edu) and Kadin Tseng (kadin@bu.edu)
Executable: /usr/local/bin/matlab
Keywords: matlab, plotting, math
Machines List: IBM p690, IBM p655, Linux Cluster, ACS Cluster
Related Man Pages: matlab
Related Help Pages: MATLAB on ACS, MATLAB Tutorial
(Last updated: 17:30 17-May-06)
Created August 16, 1996; Last Revised May 10, 2006; Last Modified 10:43 19-Sep-06
URL of this document: http://scv.bu.edu/documentation/software-help/mathematics/matlab.html
Go up to SCV Help Pages
|
|