Simple question regarding sorting
이전 댓글 표시
Hi, If I have two column matrixes of size Nx1 and Mx1 and I want to marge them together to make a Yx1 Column, but sorted in order how would I do this? I would not want a repeate of a number also.
채택된 답변
추가 답변 (1개)
Honglei Chen
2012년 6월 28일
x = [1 3 5 7 9]'
y = [1 2 3 4 5]'
unique(sort([x;y]))
카테고리
도움말 센터 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!