lot of throughput doesn't shown

조회 수: 1 (최근 30일)
Shahd Altalhi
Shahd Altalhi 2019년 11월 15일
댓글: Stephen23 2019년 11월 18일
clc;
close all;
%common parameters
f=6; %Frequency band [GHz]
pt=33; %transmitter power[dBm]
pr=27; %Receiver power[dBm]
n=5; %Noise figure [dBm]
Amu=10; %The median attenuation relative to free space
gt=6; %Transmitter Antenna Gain [dBi]
gr_s=2; %Receiver Antenna Gain [dBi] (stations)
B=20; %Bandwidth [MHz]
L=0.3; %Connector loss [dB]
I=1; %Interference margin loss [dB]
rs_t=-89; %Transmitter Rx Sensitivity [dBm]
rs_s=-91 ; %Receiver Rx Sensitivity [dBm]
d=0:1:10; %The range of the distance between TX and RX
%Data from user
area_type =input ('Enter type of city (1 - urban, 2 - suburban, 3 - rural):','s');
ht=input('Enter the receiver antenna height 30m<hre<1000m : ');
hr=input('Enter the receiver antenna height 1m<hre<10m : '); % Mobile Antenna Height
% Okumura Propagation Model
Lf=32.44+20*log(f)+20*log(d); %Free Space Propagation Loss
Ght=20*log(ht/200); %Transmitter Antenna Height Gain Factor
if(hr<3) %Reciver Antenna Height Gain Factor
Ghr=20*log(hr/3);
else
Ghr=10*log(hr/3);
end
Garea=13;
L50=Lf+Amu-Ght-Ghr-Garea;
Rss=pt+gt+gr_s-L50-L;
SNIR=Rss/(n+I);
Throughput=B.*log2(1+(10.^(SNIR(end)/10)));
for r=1:10
L50=Lf+Amu-Ght-Ghr-Garea;
Rss=[Rss*(pt+gt+gr_s-L50(end)-L)];
SNIR=[SNIR*(Rss(end)/(n+I))];
Throughput=Throughput.*(B.*log2(1+(10.^(SNIR(end)/10))));
end
hold on;
figure (1)
subplot(2,2,1)
plot(d,L50,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('Propagation Path loss(dB)');
subplot(2,2,2)
plot(d,Rss,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('RSS');
subplot(2,2,3);
plot(d,SNIR,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('SNIR');
subplot(2,2,4);
plot(d,Throughput,'LineWidth',1.5)
title('Okumura Model Analysis- Urban');
xlabel(' distance (Km)');
ylabel('Throughput');
hold off;
  댓글 수: 1
the cyclist
the cyclist 2019년 11월 15일
I answered what appears to be the identical question here.

댓글을 달려면 로그인하십시오.

답변 (1개)

Siriniharika Katukam
Siriniharika Katukam 2019년 11월 18일
Hi
The variable “Throughput” is defined in two ways in your code
Throughput=B.*log2(1+(10.^(SNIR(end)/10)));
Throughput=Throughput.*(B.*log2(1+(10.^(SNIR(end)/10))));
Make sure that you defined it properly. Moreover, this variable is a scalar since you used SNIR(end), hence it cannot be plotted unless it is an array of values.
  댓글 수: 1
Stephen23
Stephen23 2019년 11월 18일
"hence it cannot be plotted unless it is an array of values."
Actually scalars can be plotted, but because the default LineSpec has no markers the points are not visible... but the points can certainly be plotted without error (i.e. the line objects will exist, even if they do not show in the axes).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Import, Export, and Visualization에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by