Arrange cell content in a specific order

1 vue (au cours des 30 derniers jours)
Louise
Louise le 2 Mar 2021
Modifié(e) : Stephen23 le 3 Mar 2021
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

Réponse acceptée

Stephen23
Stephen23 le 2 Mar 2021
Modifié(e) : Stephen23 le 3 Mar 2021
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 commentaire
Louise
Louise le 2 Mar 2021
It works very well !
Thanks a lot !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by