我已经在matlab中完成了547个点的最近邻居程序,并且我得到了一个大小为< 547x1 cell>的单元格阵列。这是数据:
Cell array =
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x3 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x3 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x8 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x7 double]
[1x4 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x5 double]
[1x5 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x7 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x8 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x4 double]
[1x8 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x4 double]
[1x9 double]
[1x3 double]
[1x6 double]
[1x4 double]
[1x4 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x9 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x9 double]
[1x4 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x3 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x5 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x7 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x6 double]
[1x4 double]
[1x5 double]
[1x6 double]
[1x4 double]
[1x6 double]
[1x3 double]
[1x8 double]
[1x4 double]
[1x8 double]
[1x6 double]
[1x5 double]
[1x5 double]
[1x4 double]
[1x8 double]
[1x3 double]
数据描述了每个粒子我有多少邻居,我想要做的是用直方图表示这个数据,以便人们可以很容易地看到我有多少次6个neihbours多少次4,5,7,8。 ..如果有人可以帮助建议一种在直方图中表示和量化这些数据的方法,我很难在两行之间进行阅读,看看有多少6或X数我感激
编辑:回答下面的百分比生成直方图。
我用以下方式绘制了直方图:
[nelements,centers]=hist(cellfun(@numel,S));
numNeighbors = cellfun(@numel,S);
[nelements,centers]=hist(numNeighbors,unique(numNeighbors))
pcts = 100 * nelements / sum(nelements)
figure
bar(centers,pcts)
在y轴上显示每个x值出现的百分比,现在可以显示直方图上的百分比数字,如上图所示,这样可以很容易地看到数字???
答案 0 :(得分:1)
假设您的单元格数组为C
,然后尝试hist(cellfun(@numel,C))
。为了更好地展示,可能:
numNeighbors = cellfun(@numel,C);
hist(numNeighbors,unique(numNeighbors))