Sort tables within a cell by size

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

 Respuesta aceptada

Jan
Jan el 8 de Mzo. de 2021
Editada: Jan el 9 de Mzo. de 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 comentario

Lutetium
Lutetium el 8 de Mzo. de 2021
thanks, works perfectly! just had to replace length by height since its a timetable
I appreciate your help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Etiquetas

Preguntada:

el 8 de Mzo. de 2021

Editada:

Jan
el 9 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by