find the number of occurances
2 ビュー (過去 30 日間)
古いコメントを表示
my matrix is x=[ 1 1 1 3 3 4 4 4 6 7]
i want the output as y=[ 3 2 3 1 1]
i want to find how many times a particular value is occuring
0 件のコメント
採用された回答
その他の回答 (1 件)
madhan ravi
2018 年 11 月 13 日
x=[ 1 1 1 3 3 4 4 4 6 7]
u = unique(x) %unique numbers
y=histc(x,u) %occurences
bonus = [u; y]' %relation between them
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!