CDF plot is not starting from zero in y axis and does not rest on 1.

4 visualizzazioni (ultimi 30 giorni)
I am calculating the energy efficiency (EE) of a wireless network and my values are very simillar as shown in code below. I want to plot the CDF curve for EE and make the following code.
w=[0 102.0100 103.560 105.3177 104.9670 104.9497 105.0100 105.1079 105.2866 104.9930 105.2124 105.1465 105.1701 105.0588 105.2687]
[F,X,Flo,Fup] = ecdf(w);
plot(X,F);
hold on;
curve :
cdf plot.png
The plot obtained by executing the code is not starting from zero in y axis and most of the values are lying between 104 to 106 and it is also not visible by this curve. I want the plot simillar to the curve attached. If any body have any idea please help me. Thanks you.1.png
  3 Commenti
Shweta Rajoria
Shweta Rajoria il 3 Dic 2018
Thank you Akira, first part is clear to me. even if i am removing zero i am getting a straight vertical line around 105 but it should horizontal after reaching one around 105. And on removing zero, graph is not starting with zero as in figure 2. How could i get the graph similar to figure 2.
Christopher Creutzig
Christopher Creutzig il 3 Dic 2018
Your data simply has a different shape than that example.
That said, the sample plot you listed uses logarithmic scaling on the x axis. Also, ecdf does not know where the range of observable values starts and places the 0 at the lowest value it sees. To get the 0 starting value further to the left, reassign its x coordinate:
w=[102.0100 103.560 105.3177 104.9670 104.9497 105.0100 105.1079 105.2866 104.9930 105.2124 105.1465 105.1701 105.0588 105.2687];
[F,X] = ecdf(w);
X(1) = 100;
plot(X,F);
set(gca,'XScale','log')

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Wireless Communications in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by