sort cell arrays based on mean value
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a 1*8 cell variable. I wanna sort these cells based on their mean values.
The mean valuse are as below:
Thanks,
Amir
0 件のコメント
採用された回答
Star Strider
2021 年 7 月 17 日
Try something like this —
c = mat2cell(rand(150,1), [10 20 30 40 50], 1) % Create Cell ARray
[cm,idx] = sort(cellfun(@mean, c)) % Calculate & Sort By Means
c_sorted = c(idx) % Sorted Cell Array
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!