Sorting a cell array
古いコメントを表示
Hello, I have the following cell(data, 1x3):
data = [data{1} data{2} data{3}]
data{1} data{2} data{3}
A 15 1400
A 3 250
B 10 1100
C 13 1350
B 7 600
Now I would like to sort the data and make a new cell as follows:
newcell = [newcell{1} newcell{2} newcell{3}]
newcell{1} newcell{2} newcell{3}
A [15; 3] [1400; 250]
B [10; 7] [1100; 600]
C [13] [1350]
In other words, I want to sort and save the data of a cell with respect to A, B and C. Would you please show me how to do that with or without using for loop etc?
Thanks in advance.
2 件のコメント
Geoff Hayes
2015 年 6 月 17 日
Yongmin - why don't you want to use a for loop?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および 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!