how to plot empirical cdf in matlab release 2013a

1 回表示 (過去 30 日間)
mohamed Faraj
mohamed Faraj 2019 年 9 月 10 日
回答済み: Star Strider 2019 年 9 月 10 日
I have matlab release 2013a but the ecdf command is not available for this release. Is there an alternative solution to plot the empirical cdf in release 2013a?.

採用された回答

Star Strider
Star Strider 2019 年 9 月 10 日
One approach:
x = randn(100,1); % Create Data
binrng = linspace(-5, 5, 26); % Choose Bin Centres
hx = histc(x, binrng); % Histogram Counts
chx = cumsum(hx)/numel(x); % Cumulative Sum
figure
plot(binrng, chx)
grid
In histc, the bin ranges are the bin centres. It calculates the bin edges from them.
Experiment to get the result you want.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by