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
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.
Stephen23
Stephen23 2016년 10월 26일
편집: Stephen23 2016년 10월 26일
@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개)

Steven Lord
Steven Lord 2016년 10월 26일

0 개 추천

If you have these "variables" as MAT-files on disk, see Walter's answer.
If you've created variables with those names in your workspace, DON'T DO THAT.

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

질문:

Ari
2016년 10월 26일

편집:

2016년 10월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by