How to sort a cell array of chars in descending order

12 visualizzazioni (ultimi 30 giorni)
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}

Risposte (1)

madhan ravi
madhan ravi il 16 Lug 2020
V = sort(array);
Wanted = V(end : -1 : 1)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by