28-12-2012, 04:41 PM
A Beginner’s Guide to MATLAB
![Adobe Acrobat PDF .pdf](https://seminarproject.net/images/attachtypes/pdf.gif)
INTRODUCTION
MATLAB, which stands for MATrix LABoratory, is a state-of-the-art mathematical software
package, which is used extensively in both academia and industry. It is an interactive program
for numerical computation and data visualization, which along with its programming capabilities
provides a very useful tool for almost all areas of science and engineering. Unlike other
mathematical packages, such as MAPLE or MATHEMATICA, MATLAB cannot perform
symbolic manipulations without the use of additional Toolboxes. It remains however, one of the
leading software packages for numerical computation.
As you might guess from its name, MATLAB deals mainly with matrices. A scalar is a 1-by-1
matrix and a row vector of length say 5, is a 1-by-5 matrix. We will elaborate more on these and
other features of MATLAB in the sections that follow. One of the many advantages of
MATLAB is the natural notation used. It looks a lot like the notation that you encounter in a
linear algebra course. This makes the use of the program especially easy and it is what makes
MATLAB a natural choice for numerical computations.
The purpose of this tutorial is to familiarize the beginner to MATLAB, by introducing the basic
features and commands of the program. It is in no way a complete reference and the reader is
encouraged to further enhance his or her knowledge of MATLAB by reading some of the
suggested references at the end of this guide.
MATLAB at Loyola College
MATLAB runs from ANY networked computer (e.g. your dorm room, the Math Lab in KH 318,
etc). To access it, go to the MetaFrame Presentation Server, located at
http://www.loyola.edu/moresoftware/ , and login using your Groupwise username and password
- if your Groupwise password will not work then try you student ID number as a password. Once
you login you will see a folder with applications, MATLAB being one of them. Double-click on
the MATLAB icon and off you go ... Note: It is possible that the first time you do this, you may
have to install some client software on your PC. Simply follow the instructions on the webpage
(after you login) and you should be fine.
How to read this tutorial
In the sections that follow, the MATLAB prompt (») will be used to indicate where the
commands are entered. Anything you see after this prompt denotes user input (i.e. a command)
followed by a carriage return (i.e. the “enter” key). Often, input is followed by output so unless
otherwise specified the line(s) that follow a command will denote output (i.e. MATLAB’s
response to what you typed in). MATLAB is case-sensitive, which means that a + B is not the
same as a + b. Different fonts, like the ones you just witnessed, will also be used to
simulate the interactive session.
Vectors and matrices
We have already seen how to define a vector and assign a variable name to it. Often it is useful
to define vectors (and matrices) that contain equally spaced entries. This can be done by
specifying the first entry, an increment, and the last entry. MATLAB will automatically figure
out how many entries you need and their values. For example, to create a vector whose entries
are 0, 1, 2, 3, …, 7, 8, you can type