How to print most repeated Value in MATLAB
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following array, I want to print the value which is repeated mostly in array.
How can i do that in MATLAB
0 件のコメント
回答 (2 件)
Steven Lord
2022 年 12 月 17 日
x = randi(5, 6, 6)
mostCommonInColumns = mode(x)
mostCommonInMatrix = mode(x, 'all')
0 件のコメント
KSSV
2022 年 12 月 17 日
a = [1 2 2 2 3 3 4 4 4] ;
[c,ia,ib] = unique(a);
C = accumarray(ib,1) ;
[c' C]
3 件のコメント
Voss
2022 年 12 月 17 日
@Med Future: The dataset you have attached contains 492 unique values. That is, there are no repeated values.
load reprctedvalue
numel(clusters1)
numel(unique(clusters1))
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!