sorting the values of a vector into a new one by its elements size
1 次查看(过去 30 天)
显示 更早的评论
Hey all
I made some measurements. Between these values, I interpolated. Now, I want to merge both vectors into one but withouth changing the order. Just copy in the new interpolated values into the intervalls of the measured values.
Is there a predefined function from matlab or do I have to write it myself?
Thanks in advance
2 个评论
采纳的回答
Luna
2018-11-29
Try this,
xnew = sort(horzcat(y,x)) % concatane vectors then sort all
%% OR
xnew = horzcat(sort(y),sort(x)) % sort x, sort y seperately then concatanate
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!