Simple question regarding sorting
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Wayne King
2012-6-28
编辑:Wayne King
2012-6-28
X = randi(30,100,1);
Y = randi(30,50,1);
Z = unique([X ; Y]);
The result from unique() is sorted.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 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!