フィルターのクリア

Re-bin My Data is Discrete Energy Values

2 ビュー (過去 30 日間)
Chad
Chad 2011 年 12 月 16 日
Hi I am trying to rebin my data is discrete values.
Energy Amount
11.8652 3.5891
12.5513 6.6741
11.8652 3.5891
8.8125 1.1711
8.8125 2.3422
8.8125 1.1711
5.7598 0.3324
5.0737 0.9444
5.7598 0.3324
12.5513 6.6741
14.1000 19.0596
12.5513 6.6741
8.8125 2.3422
0.0000 0.0000
8.8125 2.3422
5.0737 0.9444
3.5250 7.2712
5.0737 0.9444
11.8652 3.5891
12.5513 6.6741
11.8652 3.5891
8.8125 1.1711
8.8125 2.3422
8.8125 1.1711
5.7598 0.3324
5.0737 0.9444
5.7598 0.3324
I am very thankful that Walter Roberson helped me with < * http://www.mathworks.com/matlabcentral/answers/22879-binning-for-a-histogram a very useful technique> as follows.
[uvals, a, uidx] = unique(YourData(:,1));
Sum = accumarray(uidx, YourData(:,2));
plot(uvals, Sum)
However, I am unable to bin the data in discrete bins. For example, I would like to re-bin my data from 1-2 Energy and then 2-3 Energy so and so. Bascially, I would like a histogram that shows the Energy values in the x-axis. I hope this is clear.

採用された回答

Walter Roberson
Walter Roberson 2011 年 12 月 16 日
Sum = histc(YourData, BinBoundaries);
  18 件のコメント
Walter Roberson
Walter Roberson 2011 年 12 月 19 日
Sum = accumarray(binidx(:), Amount, [length(unneeded),1] )
Chad
Chad 2011 年 12 月 19 日
Thanks...I have a good clean working script. Very helpful..
Chad

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by