直方图中的 MATLAB bins 设置

MATLAB bins setting in histogram

我想更改数据在直方图中的分布方式,我 built.My 直方图看起来像

但我希望它看起来像

我设置

bins1=[10,30,50,70];
hist(data,bins1) 

我怎样才能像第二张图那样排列垃圾箱?

使用 histc 而不是 histhistc 允许您定义边,而 hist 使用第二个输入参数作为中心。