The ecdf(x) always starts from the origin of the axis

조회 수: 5 (최근 30일)
Jose Rego Terol
Jose Rego Terol 2020년 5월 26일
댓글: Ameer Hamza 2020년 5월 26일
Hi,
The curve of ecdf starts at f(x)=0.2, x=0.04, but MatLab doesn´t feel it is a good beginning, so the curve always starts from f(x)=0, x=0. I cannot change it, and it pissed me off because I cannot interpret the curve onset accurately. I am using ecdf because I want to plot the cumulative frequency distribution. I want to remove the part of the curve within the red rectangle.
Any workaround?
Thanks
  댓글 수: 4
Jose Rego Terol
Jose Rego Terol 2020년 5월 26일
the code is this function. Nothing less nothing more.
ecdf(x)
I have attached the variable x (cumulative_dist_freq)
Jose Rego Terol
Jose Rego Terol 2020년 5월 26일
Ok, I got the problem. The variable has many zeros. It should not have happened. Thanks anyways.

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

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 26일
Try this
[f, x] = ecdf(fluc_freq);
mask = x > 0;
plot(x(mask), f(mask))

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by