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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by