How to sort the rows of a cell?

1 Ansicht (letzte 30 Tage)
Nethravathi S
Nethravathi S am 3 Okt. 2021
Kommentiert: Nethravathi S am 4 Okt. 2021
Hello,
I have a (4,1) cell.
How to sort the contents of the cell rowwise.

Akzeptierte Antwort

dpb
dpb am 3 Okt. 2021
s=sort([x{:}]); % where x is the cell array

Weitere Antworten (1)

Image Analyst
Image Analyst am 3 Okt. 2021
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.

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by