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

조회 수: 4 (최근 30일)
Shweta Rajoria
Shweta Rajoria 2018년 12월 3일
댓글: Christopher Creutzig 2018년 12월 3일
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
Shweta Rajoria
Shweta Rajoria 2018년 12월 3일
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 2018년 12월 3일
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')

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Wireless Communications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by