Arrange cell content in a specific order

1 Ansicht (letzte 30 Tage)
Louise
Louise am 2 Mär. 2021
Bearbeitet: Stephen23 am 3 Mär. 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

Akzeptierte Antwort

Stephen23
Stephen23 am 2 Mär. 2021
Bearbeitet: Stephen23 am 3 Mär. 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);

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by