Centering a histogram around the median

5 ビュー (過去 30 日間)
A
A 2011 年 9 月 29 日
Hey, I have data that I am plotting a histogram with, and I want to center my histogram on the mean, with six bins (i.e 3 on each side). I need that each bin is the width of the standard deviation. Thanks in advance for any replies. Cheers, Amina

回答 (1 件)

Honglei Chen
Honglei Chen 2011 年 9 月 29 日
Hi Amina,
You can specify the bin location in hist function, for example
x = rand(1024,1);
sigmax = std(x);
mx = mean(x);
binloc = (-2.5:2.5)*sigmax+mx;
hist(x,binloc)
More details can be found at
doc hist
HTH

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Translated by