MS&E 251 Stochastic Decision Models
M. O’Sullivan & A. F. Veinott, Jr.
Rev 1:35 am, 1/7/05
WHAT IS MATLAB?
MATLAB is a software package available via your Leland account. You can also buy a
student or professional version for your PC or MAC. MATLAB is designed for the ma-
nipulation and visualization of matrices, and analysis of large amounts of data.
HOW DO I START MATLAB?
To use MATLAB, first log into your Leland account using either tree.stanford.edu,
firebird.stanford.edu or raptor.stanford.edu. Not only do they run MATLAB much fas-
ter than cardinal, but if you log on to cardinal.stanford.edu you may be knocked off
of MATLAB. Once you have logged on to your Leland account and your msande251 direc-
tory, type "matlab", e.g.,
MATLAB responds with:
< M A T L A B >
The MathWorks, Inc.
Version 184.108.40.20601 (R14)
May 06, 2004
To get started, type one of these: helpwin, helpdesk, or demo
For product information, visit www.mathworks.com.
The above >> is the MATLAB prompt. A MATLAB command is executed by typing it at this
prompt and then striking the ENTER key. What follows is the MATLAB reply. In the se-
quel the lines with >> are command lines and the rest are MATLAB replies.
HOW DO I QUIT?
Type "quit" from the command line, e.g.,
Typing "help general" will give information on general purpose commands useful for
navigating MATLAB. UNIX shell commands may also be executed by putting a ! before
the command. For example, to edit a file "words.txt" using EMACS while running MAT-
LAB type "!emacs words.txt".
MATLAB was originally written as a matrix manipulation program, and therefore tends
to try to deal with everything as a matrix. Although it is possible to input equa-
tions, assign variables, and use a lot of mathematical functions, to make efficient
use of MATLAB, it is necessary to use matrices. To enter a small matrix, type