how can we plot Normal random distribution?
Show older comments
Hi everyone,I need help in plotting normal distribution for different path-loss values of a users distributed randomly in a circle. i have calculated distance dependent indoor path-loss model with distance formula. I am using R=normrand(mu,sigma) where mu is my mean path-loss value after 1000 iteration(inner loop) with fixed sigma of 4. but the plot shows alot of variation instead of increasing or decreasing curve after outer loop iteration (1000). my code chunk and plot is given bellow kindly help me with this ASAP.

for t=1000
for n=1000
N=randi([1,15])
for i=1:N
D(i)=sqrt((xR(i)-p).^2+(yR(i)-q).^2);
path_lossdb(i)=43.3.*log10(D(i))+ 11.5 + 20.*log10(fc);
path_loss(i)=(10.^(path_lossdb(i)./10))
end
Total_pathloss(n)=sum(Snr_Lte)./(length(Snr_Lte));
log_Total_pathloss(n)=10*log(Total_pathloss(n));
end
sigma=4;
mean_pathloss=sum(log_Total_pathloss)./1000;
R= normrnd(mean_pathloss,sigma);
W(t)=(R);
end
1 Comment
dpb
on 19 Nov 2016
I've no idea what you're trying to do here, but
for t=1000
for n=1000
does nothing except set t and n to the value 1000 for one iteration through those two loops. Subsequently,
...
Total_pathloss(n)=sum(Snr_Lte)./(length(Snr_Lte));
log_Total_pathloss(n)=10*log(Total_pathloss(n));
will set the 1000 th entry in the two arrays to the computed value of the RHS but the rest of the array from 1:999 will be identically 0. Similarly, except for the one value of t in the subsequent assignment of W.
...
W(t)=(R);
Answers (0)
Categories
Find more on Rayleigh Distribution 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!