regarding an array with periodic set of elements,how can i move the portion with maximum number to the beginning of the periodic set of elements?

2 ビュー (過去 30 日間)
Joseph
Joseph 2017 年 5 月 23 日
編集済み: Joseph 2017 年 5 月 23 日
lets say i have an array with periodic set of elements such as below:
A=[2 2 2 3 3 4 4 5 5 5 1 1 1 2 2 2 2 3 3 4 4 4 4 5 5];
i want to move the elements with maximum number which in this case is 5 to the beginning of the period of the elements and make array B as below:
B=[5 5 5 2 2 2 3 3 4 4 5 5 1 1 1 2 2 2 2 3 3 4 4 4 4];
i greatly appreciate your help
thank you

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by