How to sort a cell array of chars in descending order

16 次查看(过去 30 天)
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}

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by