Borrar filtros
Borrar filtros

Sort tables within a cell by size

2 visualizaciones (últimos 30 días)
Lutetium
Lutetium el 8 de Mzo. de 2021
Editada: Jan el 9 de Mzo. de 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

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

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by