Effacer les filtres
Effacer les filtres

Sort tables within a cell by size

3 vues (au cours des 30 derniers jours)
Lutetium
Lutetium le 8 Mar 2021
Modifié(e) : Jan le 9 Mar 2021
I'm struggling a bit to sort several timetable according to their length. Can someone help me to get the right syntax?
I appreciate the input

Réponse acceptée

Jan
Jan le 8 Mar 2021
Modifié(e) : Jan le 9 Mar 2021
Try this - I cannot check it, because I do not have your input data:
Len = cellfun(@height, C); % [EDITED] @length -> @height
[~, index] = sort(Len);
C = C(index);
  1 commentaire
Lutetium
Lutetium le 8 Mar 2021
thanks, works perfectly! just had to replace length by height since its a timetable
I appreciate your help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by