Sort tables within a cell by size

1 回表示 (過去 30 日間)
Lutetium
Lutetium 2021 年 3 月 8 日
編集済み: Jan 2021 年 3 月 9 日
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

採用された回答

Jan
Jan 2021 年 3 月 8 日
編集済み: Jan 2021 年 3 月 9 日
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 件のコメント
Lutetium
Lutetium 2021 年 3 月 8 日
thanks, works perfectly! just had to replace length by height since its a timetable
I appreciate your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by