Starting Matlab on UNIX

foulchilianΤεχνίτη Νοημοσύνη και Ρομποτική

20 Οκτ 2013 (πριν από 4 χρόνια και 23 μέρες)

235 εμφανίσεις



Using
MATLAB

MATLAB is an interactive matrix manipulation program which
allows the user to perform standard operations such as
inverse, transpose eigenvec
tor and eigenvalue computations


Ian C. Smith

September

2009

Document 486

Computing Services Department
MWS /
UNIX


Sun

Service

Contents

1

I
NTRODUCTION

1

2

S
TARTING
MATLAB

2

Matlab on the Managed Windows Service

2

Starting Matlab on UNIX

2

3

F
URTHER
I
NFORMATION

4

4

R
UNNING LARGE NUMBERS

OF
M
ATLAB SCRIPTS

5











Format Conventions

In this document the following format conventions are used:

Computer output is given in a Courier font.

Password

Input which is to be typed by you is in bold

a:
\
setup

Input which must be replaced by your details is given
in
bold

italics
.

LOGIN

user_name


Keys that you press are bold.

Enter

Menu options are given in a Helvetica font.

File New

Feedback

The Computing Services Department welcomes feedback on its documentation. If you notice
any mistakes in this document, or if you wish to make any suggest
ions on how the document
could be improved, please contact Allyson Matthews, Information Officer. Electronic mail
should be sent to the email address
allyson@liv.ac.uk



1

1

Introduction

MATLAB is an interactive matrix manipulation program. MATLAB integrates numerical
analysis, matrix computation, signal processing and graphics in an environment where
problems and solutions are expressed as they are written mathematically.
MATLAB has a
num
ber of ‘
toolboxes
’ to solve specific tasks.
The following t
oolboxes

are available:



Simulink



Bioinformatics Toolbox



Control System Toolbox



Curve Fitting Toolbox



Data Acquisition Toolbox



Distributed Computing Toolbox



Genetic Algorithm & Direct Search Toolbox



Image Processing Toolbox



Instrument Control Toolbox



MATLAB Compiler



Neural Network Toolbox



Optimization Toolbox



Partial Differential Equation Toolbox



Real
-
Time Workshop



Signal Processing Blockset



Signal Processing Toolbox



SimMechanics



Simscape



Simulink Co
ntrol Design



Simulink Verification and Validation



Stateflow



Statistics Toolbox



System Identification Toolbox



Wavelet Toolbox


See Section 3

for further details.



2

2

Starting MATLAB

Matlab on the Managed Windows Service

Matlab need
s

to be installed before it can be used.
To install the R2009a release click:



Start | In
stall University Applications

then select 'Matlab 2009

-

install
' from the Mathematics category.

On many teaching centre PCs, Matlab is already pre
-
installed locally

on the hard disk (C:
drive). A list of pre
-
installed applications is displayed when logging in.

The installation process will create a matlab directory on you
r M
:
drive
(networked file
store). Work created in a Matlab session will be saved here by defau
lt.
If you access
functions stored in M
-
files then, by default, Matlab will locate these in the m:
\
matlab
directory first. M
-
files in other directories can be found by using the
addpath

command.

Starting Matlab on U
NIX

MATLAB uses a graphical interface to

deliver a n
umber of its functions which is provided
using X/Windows. On a MWS PC you will need to run an X server such as eXceed for
the interface to work. Linux based PCs should have their own built
-
in X server running
(e.g. under a desktop manager such

as GNOME, KDE etc).

In order to access the MATLAB software you will need to log on to the Sun UNIX
Service.



To start a terminal session on one of the
central servers (for example uxa
), after
you have logged in you need to select
the CSD Named Host

icon
on the CDE
front panel (see figure) by clicking with the mouse.




When prompted type the name of a central

server (uxa or uxb
). The terminal
session will have the correct ‘X’ environment variables set for X programs to
display info
rmation on your screen. If you use an alternate method to access the
central servers then you will need to ensure the X environment and in particular the
DISPLAY environment variable is set correctly.


3

The best method of organising your work is to create a

directory called
matlab

in your
home directory (or under
~/
.lfs if you have access to the large filestore)
.

You can do this
with the following UNIX commands:

cd

mkdir matlab

You would only need to do this once. Having created your matlab

subdirectory move into
it by typing

cd matlab

Then to start MATLAB type

matlab

This will start your MATLAB session. MATLAB is command driven and you will see a
prompt
>>

which is an invitation for you to type a MATLAB command. Please refer to
either your
course notes or the MATLAB documentation for details on using MATLAB.

Help is available either by clicking the mouse on the Help Menu by typing

HELP

at the Matlab command prompt.

Help is also available on individual commands. For example:

HELP LOG

will gi
ve information on how to use natural logarithms.

In order to return to the UNIX prompt you can either type:

QUIT

or

EXIT

as a MATLAB command.



4

3

Further Information

Documentation is available on line after you have started Matlab. This
can be accessed as

interactive help, by locating the Help menu at the top right of the Matlab window.
Documentation
on Matlab and its toolboxes
suitable for printing is also available
within

the help system as ‘pdf’ files.



5

4

Running large numbers of Matlab
scripts

If you need to run very large numbers of Matlab M
-
file scripts possibly with different
input data or in Monte Carlo type simulations you may want to consider using the CSD
Condor Pool. This allows very large numbers of jobs

(up to around 600 at present)

t
o be
run concurrently on teaching centre PCs at times at which they would otherwise be idle.
More details are available on the CSD Condor Pool web pages at:

http://www.liv.ac.uk/e
-
science/condor

http://www.liv.ac.uk/
e
-
science/condor/matlab/