Combining two vectors of different elements in an order

조회 수: 3 (최근 30일)
Raghavendra Reddy P
Raghavendra Reddy P 2015년 5월 26일
댓글: 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(:)']);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by