plot the recieved power as a function of distance
Show older comments
I need to plot recieved power as a function of distance but i cant get the correct answer. may any one help me?

the function is pr and we need to plot (ds,pr).
i calculate all of parameters i just cant plot it as it desired.
here is the code that i write.
note: delta phi=2*pi*(d(a)-ds))/(lambda)
r=[-1.3772 - 0.3563i -0.7217 + 0.1599i -0.6364 + 0.1913i -1.4569 - 0.4529i]
d=[204.2084 202.5438 200.1599 204.2084]
for a=1:4
ds=200;
gmain=20; %in db
pt=30; % in dbm
lambda=0.005;
g=[21 22 23 25]; %this g matrix is just an assumption and not real values--i should find and replace them with valid values
q=(20*log10(r(a))+g(a)+20*log10(exp((-2i*pi*(d(a)-ds))/(lambda))))-(20*log10(d(a)))
end
ds=0:5:200
pr=pt+20*log10(1/(800*pi))+((gmain-(20*log10(ds))+(q)))
plot(ds,pr)
Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!