contacting people | a-z index | help | search;
  

 


 


 


   
   
   
   
   
   
   
   
   
   
   
   
   

MATLAB

Description

MATLAB (MATrix LABoratory) is a package for numeric computation and visualization. This package integrates numerical analysis, matrix computation, signal processing and advanced graphics in an easy-to-use environment. Although traditional programming skills are not required to use this package, it is also possible to create your own complex applications in the MATLAB language.

MATLAB was originally written to provide easy access to the LINPACK and EISPACK software libraries. It is now maintained by MathWorks, Inc. The current version is Matlab Version 7.4.

Documentation

The following manuals are relevant to MATLAB Version 7.4:

  • MATLAB User's Guide

A copy of this manual set is kept by Ian Stewart, ext 87866.

Links

How to access MATLAB

To access MATLAB type: matlab

Please note that Matlab is not automatically added to your environment when you log on to BlueCrystal.

A module has been set up : apps/matlab-R2012a

If you want to use Matlab you must execute the following command: module add apps/matlab-R2012a

If you are running Matlab jobs through the queues, you should also remember to include the appropriate module add command in your job submission script.

Examples

Commands to get started: intro, demo, help

Commands for more information: help, whatsnew, info, subscribe

How to use MATLAB

MATLAB may be run in either unattended mode for use with the queuing system or in interactive mode.

To use MATLAB in unattended mode, prepare a file of MATLAB commands (a so-called "M-file"), with a quit statement at the end.

For example, suppose the following commands (to approximate a Fourier expansion of a sawtooth function and save a plot of the result to a PostScript file) are placed in a file called cosplot.m:

% MATLAB M-file example to approximate a sawtooth
% with a truncated Fourier expansion.
nterms=5;
fourbypi=4.0/pi;
np=100;
y(1:np)=pi/2.0;
x(1:np)=linspace(-2.0*pi,2*pi,np);
for k=1:nterms
twokm=2*k-1;
y=y-fourbypi*cos(twokm*x)/twokm^2;
end;
% (The following commands are for generating graphics output.)
plot(x,y);
print -dpsc matlab_test_plot.ps;
quit;

To run MATLAB interactively on BlueCrystal

matlab < cosplot.m

However, like other jobs on BlueCrystal, if one is doing more than very short debugging runs, MATLAB jobs should be submitted to the queuing system for scheduling. This is done by putting the MATLAB command line in a script which is then submitted to the queuing system using the qsub command. See the user guide for more details on the queuing system and job submission scripts.

As there only a limited number of matlab licenses, you should submit to the special queues matlab (to run on standard nodes), or matlab-himem (to run on the high memory nodes). These queues will only let a certain number of jobs run at once, and hold the others ready to run when a license becomes free.

Here is an example of a simple job submission script which uses the input file cosplot.m - which I have put in my directory TEST_MATLAB

#!/bin/tcsh
#
#PBS -l walltime=1:00:00
#PBS -mae
#PBS -joe
#PBS -q matlab
#
cd ${HOME}/TEST_MATLAB
matlab -nodisplay -nojvm -nodesktop -nosplash < cosplot.m

 

 

university home | a-z index  | help | © 2002-2011 University of Bristol