The lot of plot doesn't shown

1 visualización (últimos 30 días)
Shahd Altalhi
Shahd Altalhi el 15 de Nov. de 2019
Editada: the cyclist el 15 de Nov. de 2019
clc;
close all;
%common parameters
f=150; %Frequency band [GHz]
pt=40; %transmitter power[dBm]
pr=27; %Receiver power[dBm]
n=6; %Noise figure [dBm]
Amu=29; %The median attenuation relative to free space
gt=17; %Transmitter Antenna Gain [dBi]
gr_s=15; %Receiver Antenna Gain [dBi] (stations)
gr_h=2; %Receiver Antenna Gain [dBi] (handset)
B=10; %Bandwidth [MHz]
L_interface=3; %Interference margin loss [dB]
L=0.3; %Connector loss [dB]
I=3; %Interference margin loss [dB]
rs_t=-88.9; %Transmitter Rx Sensitivity [dBm]
rs_s=-90.9 ; %Receiver Rx Sensitivity [dBm]
d=1:1:10;
%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 d=1:1:10
Throughput=Throughput.*(B.*log2(1+(10.^(SNIR(end)/10))));
disp(Throughput);
end
plot(r,Throughput,'LineWidth',1.5)
title('Okumura Model Analysis- suburban');
xlabel(' distance (Km)');
ylabel('Throughput');
hold off;
  1 comentario
the cyclist
the cyclist el 15 de Nov. de 2019
I tried to run your code, but the plot didn't work because r is not defined.

Iniciar sesión para comentar.

Respuestas (1)

the cyclist
the cyclist el 15 de Nov. de 2019
Editada: the cyclist el 15 de Nov. de 2019
In your code, Throughput is just a single value, that gets overwritten during each iteration of the for loop.
I'm guessing you want Throughput to be defined as a vector, and inside the for loop you'll want to assign values to
Throughput(d)
instead.

Categorías

Más información sobre Antennas, Microphones, and Sonar Transducers en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by