Combining two vectors of different elements in an order

2 ビュー (過去 30 日間)
Raghavendra Reddy P
Raghavendra Reddy P 2015 年 5 月 26 日
I have two vectors >> n=[2 18 5 22 29]; >> m=[3 6 17 20 30]; I wanted a new vector mn, which contains both the elements of n and m vector in an order such as >> mn=[2 3 5 6 17 18 20 22 29 30]

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 5 月 26 日
mn = sort([n(:)',m(:)']);
  1 件のコメント
Raghavendra Reddy P
Raghavendra Reddy P 2015 年 5 月 26 日
Thank you sir... it works exactly the way i wanted :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by