我已经在 matlab 中完成了 547 个点的最近邻程序,结果得到了一个大小为 <547x1 单元格> 的单元格数组,这是数据:
元胞数组 =
[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 个邻居多少次 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 轴上显示每个 xvalue 出现的百分比,现在可以在直方图上显示百分比数字,就像我在上图中添加的那样,这样人们就可以轻松地看到数字???