How to sort the rows of a cell?

2 visualizaciones (últimos 30 días)
Nethravathi S
Nethravathi S el 3 de Oct. de 2021
Comentada: Nethravathi S el 4 de Oct. de 2021
Hello,
I have a (4,1) cell.
How to sort the contents of the cell rowwise.

Respuesta aceptada

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

Más respuestas (1)

Image Analyst
Image Analyst el 3 de Oct. de 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.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by