フィルターのクリア

How to sort a cell array of chars in descending order

5 ビュー (過去 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 件のコメント
Mehmed Saad
Mehmed Saad 2020 年 7 月 16 日
array = {'Orange' 'Yellow' 'Purple'};
sort(array)

サインインしてコメントする。

回答 (1 件)

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

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by