Arrange cell content in a specific order

조회 수: 1 (최근 30일)
Louise
Louise 2021년 3월 2일
편집: Stephen23 2021년 3월 3일
Hi all,
I've two variables:
> FILE_NAME with the subject ID (for example S122_JEMO) and the condition (from 40C_1 to 65C_4).
> Ankle_Angle, the cells are in the same order as FILE_NAME. e.g. Ankle_Angle{1,1} belongs to FILE_NAME{1,1}
My goal is to arrange these two cell contents from the lowest subject ID to the highest one (i.e. S2, then S15, S122, S129 and S140).
My work is quite urgent and I've really no idea to do that...
THANKS a lot in advance !!
Louise

채택된 답변

Stephen23
Stephen23 2021년 3월 2일
편집: Stephen23 2021년 3월 3일
One easy solution is to download my FEX submission natsortfiles:
Unzip it onto the MATLAB search path (e.g. the current folder), and then use it like this:
[sortedFN,idx] = natsortfiles(FILE_NAME);
sortedAA = Ankle_Angle(idx);
  댓글 수: 1
Louise
Louise 2021년 3월 2일
It works very well !
Thanks a lot !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by