`%Matlab cache clearing commands`

clc; %clears command window

clear all; %clears workspace variables

close all; %closes all external matlab windows

%input starts here

Hte=100; %Base Station Height between 30 m and 1000 m

Hre=10; %Mobile Station Antenna Height between 1 m and 10 m

d =1; %distance from base station between 1Km and 100Km

f=900; %Frequency between 150Mhz and 1920Mhz

Amu = 18; %Median attenuation

Kcor =9; %Correction factor

%SUBURBAN AREA

for i=1:length(f) Lfsl = 10*log((((3*10^8)/f(i))^2)/((4*pi)^2)*d^2); % finding free space loss

Ghte = 20*log(Hte/200); % Base station antenna height gain factor

if(Hre>3) Ghre = 20*log(Hre/3); % Mobile station antenna height gain factor

else Ghre = 10*log(Hre/3); end L(i) = Lfsl+Amu(i)-Ghte-Ghre-Kcor(i); % formula for path loss

end disp(L) %prints the Loss Array

% plot of Distance vs Loss (dB) for surburban

figure(1) %Enables the figure

plot(f,L); %versus plotting command

title('Distance vs Loss (dB) for open area for Okumura Model'); %title of the plot

xlabel('Distance(Km)'); %label for X-axis

ylabel('Propagation Path loss(dB)'); %label for Y-axis

grid on; %Enables Grid feature in plot

%inputs

% 50

% 5

% 10

% [200 300 400 500 600 700 800 900 1000 1100]

% [20.4 20.45 20.5 20.55 20.6 20.65 20.7 20.75 20.8 20.85]

% [23 24 25 25.5 26 27 27.5 28 28.75 29]

# MATLAB: Why when i plot the graph for the okumura model it doesnt show line

graphMATLABplot

## Best Answer