Professional Documents
Culture Documents
University of Engineering & Technology, Taxila: Lab Report 1
University of Engineering & Technology, Taxila: Lab Report 1
Technology, Taxila
LAB REPORT 1
Introduction to Programming in MATLAB
Wireless Networks-Lab
(CP-404)
LAB INSTRUCTOR
Dr. Asif Khan
SUBMITTED BY
Hareem Khan
17-CP-29
LAB TASK 01
1. Use MATLAB to draw the graph of f (x) = x2 − 2x − 3 on the
interval [−1, 3].
x=-1:3;
y=x.^2-2.*x-3;
plot(x,y)
xlabel("X-axes")
ylabel("Y-axes")
title("GRAPH of f(x)= x2?2x?3")
– Exponential Sequence
function out=Task_1_2_3(start_point,end_point,A,a)
x=start_point:end_point;
y=A*a.^x;
stem(x,y);
title('Expoential function');
xlabel('X-axes');
ylabel('Y-axes');
x = 0:0.01:2;
y = 5*x.*exp(-3*x);
subplot(1,2,1)
plot(x,y)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 1 without noise')
y1=rand(1,201);
y2=y1+y;
subplot(1,2,2)
plot(x,y2)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 2 with noise')
n=-5:5;
w1=0.10*pi;
w2=0.25*pi;
w3=pi;
w4=1.25*pi;
w5=1.50*pi;
w6=2*pi;
x1=cos(w1.*n);
x2=cos(w2.*n);
x3=cos(w3.*n);
x4=cos(w4.*n);
x5=cos(w5.*n);
x6=cos(w6.*n);
subplot(2,3,1)
plot(n,x1)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 1')
subplot(2,3,2)
plot(n,x2)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 2')
subplot(2,3,3)
plot(n,x3)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 3')
subplot(2,3,4)
plot(n,x4)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 4')
subplot(2,3,5)
plot(n,x5)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 5')
subplot(2,3,6)
plot(n,x6)
xlabel('x-axes')
ylabel('y-axes')
title('Graph 6')