Professional Documents
Culture Documents
CODE
SNR=1:5;
BPSK=[0.0190,0.0100,0.0046,0.0020,0.0008];
QPSK=[0.1316,0.0941,0.0630,0.0384,0.0202];
EIGHT_QAM=[0.0377,0.0202,0.0096,0.0041,0.0016];
SIXTEEN_QAM=[0.0478,0.0252,0.0119,0.0049,0.0018];
10 -2
10 -3
10 -4
1 1.5 2 2.5 3 3.5 4 4.5 5
SNR
subplot(2,2,1)
subplot(2,2,2)
subplot(2,2,4)
BPSK QPSK
10 0 10 0
BER
BER
10 -2 10 -1
10 -4 10 -2
1 2 3 4 5 1 2 3 4 5
SNR SNR
8 QAM 16 QAM
10 -1 10 -1
BER
BER
10 -2 10 -2
10 -3 10 -3
1 2 3 4 5 1 2 3 4 5
SNR SNR
Question 2
for r=1:2
for c=1:500
a(r,c)=sqrt((2-r+1)+2*(c-1));
end
end
a
a)
for c=1:500
b(c)=a(1,c)*a(2,c);
end
b;
mean(b)
500.4991
b)
a(:,258:264)
c)
a(2,120:125)
d)
for c=1:500
d(c,c)=a(1,c);
end
d;
Question 3
x=[25;9;21;7;2;43;28;47;35;29];
xmean=mean(x)
num=0;den=0;
for i=1:10
num=num+(x(i)-xmean);
den=den+(x(i)+xmean)^2;
r(i)=num/sqrt(den);
end
r
rtotal=sum(r)
Answers
xmean = 24.6000
r = 0.0081 -0.2537 -0.2497 -0.4458 -0.6870 -0.3715 -0.3067 -0.1051 -0.0288 -0.0000
rtotal = -2.4402
Question 4
a)
function y=fcn(u)
Y=1/6*(u.*cos(u)+exp(-3*u)+1.5*u;
end
b)
function ydot=func(t,y)
ydot(1)=y(2);
ydot(2)= 1/6*(t.*cos(t)+exp(-3*t)+1.5*t+3.6*y(1));
ydot=[ydot(1);ydot(2)];
end
[t,y]=ode45(@func,[0,6],[-6,4.2]);
plot(t,y),xlabel('t'),ylabel('y'),legend('y','ydot')
c)
[t,y]=ode45(@func,[0,6],[-6,4.2]);
>> subplot(1,2,1);
>> plot(t,y),xlabel('t'),ylabel('y'),legend('y','ydot')
>> subplot(1,2,2);
>> plot(out.integ.time,out.integ.signals.values)
Question 5