Introduction To Matlab
Introduction To Matlab
Introduction To Matlab
MATLAB
S.S.R.K.M.GUPTA.M.Tech.,(M.Phil)
Assistant Professor
Introduction
MATLAB Stands for MATrix LABoratory
Initially developed by a lecturer Cleve Moler, at the
MATLAB Functionality
Built-in Functionality includes
Matrix manipulation and linear algebra
Data analysis
Exploration and visualisation
Algorithm development
Modelling, simulation, and prototyping
Scientific and engineering graphics
Add-on toolboxes provide
Image
processing
Signal Processing
Optimization
Genetic Algorithms
and hundreds of other functions
MATLAB consists of
The MATLAB language
The MATLAB working environment
Handle Graphics
The MATLAB function library.
The MATLAB Application Program Interface
(API)
-2
-1
x = -2.9:0.2:2.9;
bar(x,exp(-x.*x));
6
0.5
1.5
2.5
3.5
4.5
Line plot:
x=0:0.05:5;y=sin(x.^2);plot(x,y);
7
0.5
1.5
2.5
3.5
Stem plot:
x = 0:0.1:4;, y =
sin(x.^2).*exp(-x); stem(x,y)
8
10
5
0
-5
-10
30
20
10
0
10
15
20
25
10
15
20
25
Surface plot:
z=peaks(25);, surf(z);, colormap(jet);
10
20
15
10
10
15
20
25
11
12
MATLAB variables
Matlab treats all variables as matrices. For our
Identifiers in Matlab
Have not to be previously declared
Variable names can contain up to 63
characters
Variable names must start with a letter
followed by letters, digits, and underscores.
Variable names are case sensitive
Matlab Special
Variables
ans
Default variable name for results
pi
Value of
eps
Smallest incremental number
inf
Infinity
NaN Not a number e.g. 0/0
realmin
The smallest usable positive real
number
realmax
number
Data Types