# Compute and plot Rayleigh Distribution probability density function

2 vues (au cours des 30 derniers jours)
Jose Iglesias le 6 Fév 2022
Commenté : Jose Iglesias le 6 Fév 2022
I am currently trying to plot the 90 and 50 percent fading ranges for three independent samples.Theh following code is for consecutive comvutions of pdf. I am able to get the cumative distribtion plot but I am having trouble converting it to the respective Rayleigh distribution pdf plot in order to find my upper and lower bound ranges. I know that the plot I need is the raylpdf function if I am not mistaken but I keep getting errors when I try to convert my plot. The code I am currently using is shown below: i am alsp attaching a pic of my current plot and the Rayleigh distribution pdf plot I am trying to convert it to.Thank you for your assistance.
N = 300;
a = 0;
b = 3;
delta = (b-a)/N;
x = linspace(a,b,N);
v = 2*x.*exp(-x.*x);
v1 = 18*x.*exp(-x.*x*9);
v2 = v1;
v3 = v1;
v4 = conv(v1,v2)*delta;
v1 = conv(v4,v3)*delta;
x = [0:3*N-3]*delta;
vcdf = cumsum(v1)*delta;
%plot(x(1:100),y,v,v1,'--');
plot(x,vcdf);
xlim([0,3]);
%legend('Rayleigh Distribution'. 'New Distribution');
xlabel('x (\sigma^(2)=0.5)');
title('(\bf Fig 2): cdf of New Distribution')
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

VBBV le 6 Fév 2022
Modifié(e) : VBBV le 6 Fév 2022
plot(x,v1,'--',x(1:300),v);
axis([0 3 0 2])
Compare it with same vector lengths to view the Pdf
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Jose Iglesias le 6 Fév 2022
It worked like a charm! Thank you so much!!

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Rayleigh Distribution dans Help Center et File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by