how to sort variable of an array?

let suppose we have 3 varaibles A=45, B=54,C=23 and we stores data in matrix M=[A B C] i want to sort on basis of their numerical value like M=[B A C] dont want to change it in numerical form

1 件のコメント

Stephen23
Stephen23 2019 年 9 月 12 日
編集済み: Stephen23 2019 年 9 月 13 日
"how to sort variable..:"
Variables in the workspace do not have an "order", so variables cannot be "sorted".
Elements of an array have an order, so array elements can be sorted.
What exactly are you trying to achieve?

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

回答 (1 件)

Matt J
Matt J 2019 年 9 月 13 日

0 投票

sort(M,'descend')

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

質問済み:

2019 年 9 月 12 日

回答済み:

2019 年 9 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by