How to sort a cell array of chars in descending order

조회 수: 14 (최근 30일)
gmltn1212
gmltn1212 2020년 7월 16일
댓글: madhan ravi 2020년 7월 16일
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