Professional Documents
Culture Documents
Experiment # 01
Introduction to MATLAB
Performed on ______________________
Student Name:
Roll Number:
Work submitted on:
Theory
The name MATLAB stands for MATrix LABoratory. MATLAB was written originally
to provide easy access to matrix software developed by the LINPACK (linear system
package) and EISPACK (Eigen system package) projects.
It has powerful built-in routines that enable a very wide variety of computations. It
also has easy to use graphics commands that make the visualization of results
immediately available. Specific applications are collected in packages referred to as
toolbox. There are tool boxes for signal processing, symbolic computation, control
theory, simulation, optimization, and several other fields of applied science and
engineering.
1. Starting MATLAB
After logging into your account, you can enter MATLAB by double-clicking on the
MATLAB shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start
MATLAB, a special window called the MATLAB desktop appears. The desktop is a
window that contains other windows. The major tools within or accessible from the
desktop are:
/*/
When MATLAB is started for the first time, the screen looks like the one that shown
in the Figure 1.1. This illustration also shows the default configuration of the
MATLAB desktop. You can customize the arrangement of tools and documents to
suit your needs.
2. Command Window
.
3. Command History
Introduction to MATLAB | 1
4. Work Space
5. Introduction
Matrices are the basic elements of the MATLAB environment. A matrix is a two-
dimensional array consisting of m rows and n columns. Special cases are column
Introduction to MATLAB | 1
vectors (n = 1) and row vectors (m = 1). In this section we will illustrate how to apply
different operations on matrices. The following topics are discussed: vectors and
matrices in MATLAB, the inverse of a matrix, determinants, and matrix
manipulation. MATLAB supports two types of operations, known as matrix
operations and array operations.
Matrix operations will be discussed first.
7. Transpose of Matrix
Introduction to MATLAB | 1
Example 1:
9. Matrix Addition
Introduction to MATLAB | 1
Introduction to MATLAB | 1
Lab Task:
Q.1: For the given matrices; verify each of the following properties.
3 3 1 1
A= B=
2 1 2 3
C= 3 1
5 8
Introduction to MATLAB | 1
2 -7 2 -1 1 4
A= B=
-6 2 1 0 -3 3
4 3 1 2 2 2
Apply:
i) A*B
ii) A.*B
1 2 3
A= 2 3 4
1 2 5
Calculate inverse of matrix A by using function inv(A) and verify following result
Inv(A) *A = 1
v = [1 2 3]
b = [2 4 6]
Compute
vT and bT
Calculate v.*b and v./b
Introduction to MATLAB | 1
A= [1 4 6; 5 7 8; 4 2 1] B= [1 1; 4 6; 4 6]
4) Which commands are used to clear Command Line and Work Space in Matlab?