Week 13 - Matlab
Week 13 - Matlab
Introduction to Matlab
Dr Jaylina Rana
Week 13
• What is Matlab?
What is Matlab?
• Numerical computing environment & programming
language.
▫ Matrix manipulation,
▫ Plotting of functions and data,
▫ Implementation of algorithms,
▫ Creation of user interfaces, and
▫ Interfacing with programs in other languages.
4
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3 -2 -1 0 1 2 3
x = -2.9:0.2:2.9;
bar(x,exp(-x.*x));
7
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Line plot:
x=0:0.05:5;y=sin(x.^2);plot(x,y);
8
0.35
0.3
0.25
0.2
0.15
0.1
0.05
-0.05
-0.1
-0.15
0 0.5 1 1.5 2 2.5 3 3.5 4
Stem plot:
x = 0:0.1:4;, y = sin(x.^2).*exp(-x);
stem(x,y)
9
10
-5
-10
30
25
20
20
15
10 10
5
0 0
10
-5
-10
30
25
20
20
15
10 10
5
0 0
Surface plot:
z=peaks(25);, surf(z);, colormap(jet);
11
25
20
15
10
5 10 15 20 25