How to sort the rows of a cell?

2 ビュー (過去 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.

カテゴリ

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