Use loop and sortrows to sort iterative matrices
古いコメントを表示
Hi,
I have several matrices named as ab1c_data, ab2c_data, ab3c_data ....abnc_data, which all contain several rows and columns. I wish to use the sortrow function in a loop to sort the rows in an ascending order of each ab'n'c_data matrices. How could I go about doing this?
Thank you!
2 件のコメント
KSSV
2016 年 10 月 26 日
How you have the matrices? In a mat file or in work space? There is sort command in matlab...read about sort.
@Ari: you really really don't want to do this. Learn to use fast and efficient indexing rather than the buggy and slow practice of accessing variable names dynamically:
回答 (2 件)
Walter Roberson
2016 年 10 月 26 日
0 投票
Steven Lord
2016 年 10 月 26 日
0 投票
If you have these "variables" as MAT-files on disk, see Walter's answer.
カテゴリ
ヘルプ センター および 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!