Borrar filtros
Borrar filtros

How to sort a cell array of chars in descending order

16 visualizaciones (últimos 30 días)
gmltn1212
gmltn1212 el 16 de Jul. de 2020
Comentada: madhan ravi el 16 de Jul. de 2020
Hi, I am trying to sort an array of chars in descending order
I tried to use sort() but its giving an error saying 'Only one input argument is supported for cell arrays'. Can anyone help me on this?
given array is 3x1 cell
array = {Orange}
{Yellow}
{Purple}

Respuestas (1)

madhan ravi
madhan ravi el 16 de Jul. de 2020
V = sort(array);
Wanted = V(end : -1 : 1)

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