Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How to code this?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all,
Currently I have matrix which rows I want to divide into bins. However, the edges of these bins should be different for every row. Example:
Data= [ 1 1.5 2 3 4; 1. 2 4 5 6;]
edges= [1 2 3; 3 4 5]
I want to use the command [counts, bins] = histc(). I can code this using a for-loop, but is there a possibility to this in a vectorized way? That the output is a 2x5 "counts" and 2x5 "bins" matrix, in which the Data rows have been split according to different edges criteria?
Thanks in advance!
Lucas
0 件のコメント
回答 (1 件)
Amit
2014 年 1 月 25 日
histc supports matrixes. So you dont hove to use for loop. http://www.mathworks.com/help/matlab/ref/histc.html
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!