本文介绍了如何用Matlab构造不相等的宽度直方图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用不相等的bin(间隔)构造一个直方图..Matlab仅用相等的bin构造直方图,就好像它是一个图.. !!!
I would like to construct a histogram with unequal bins (intervals)..Matlab construct only histograms with equal bins as if it's a diagram..!!!
请帮助我...非常感谢!
Please help me...thanks a lot!!
推荐答案
下面是一个示例:
x = randn(100,1)*3; %# some random data
e = [-10 -5 -3 -1 1 2 3 20]; %# edges of intervals: e(i) <= x < end(i+1)
c = histc(x,e); %# get count in each interval
bar(e, c, 'histc') %# bar plot
set(gca, 'xlim',[e(1) e(end)])
这篇关于如何用Matlab构造不相等的宽度直方图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!