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

 採用された回答

Jan
Jan 2021 年 3 月 8 日
編集済み: Jan 2021 年 3 月 9 日

0 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

製品

タグ

質問済み:

2021 年 3 月 8 日

編集済み:

Jan
2021 年 3 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by