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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by