How to sort the rows of a cell?

조회 수: 1(최근 30일)
Nethravathi S
Nethravathi S 2021년 10월 3일
댓글: Nethravathi S 2021년 10월 4일
Hello,
I have a (4,1) cell.
How to sort the contents of the cell rowwise.

채택된 답변

dpb
dpb 2021년 10월 3일
s=sort([x{:}]); % where x is the cell array
  댓글 수: 1
Nethravathi S
Nethravathi S 2021년 10월 4일
thank you.
it worked.

댓글을 달려면 로그인하십시오.

추가 답변(1개)

Image Analyst
Image Analyst 2021년 10월 3일
A cell can have anything it in, like arrays, structures, tables, even other cell arrays. See the FAQ:
So you can't sort them. Even if the cells contain matrices, you can't sort across cells. However you could sort the contents of each cell independently.
What is inside each of your four cells? You forgot to attach it in a .mat file so we don't know.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by