Hi, I want to group my data into 11 groups
6 ビュー (過去 30 日間)
古いコメントを表示
This is my Data-
[705.7142857 705.7142857 173.4285714 84.71428571 232.5714286 232.5714286 114.2857143 55.14285714 25.57142857 74.85714286 35.42857143 15.71428571 5.857142857 5.857142857].
I want to group same data into 1 group. This is 14*1 matrix where it has 3 pairs(705.7142857 705.7142857, 232.5714286 232.5714286 & 5.857142857 5.857142857) of same value data. So, I want these 3 pairs into 3 groups and rest of them into other 8 groups.
Is there anybody who can help me to code this?
0 件のコメント
採用された回答
Walter Roberson
2019 年 3 月 9 日
Supposing your data is in vector v then
[~, ~, uidx] = unique(v);
grouped = accumarray(uidx, v, [], @(V) {V});
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!