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
3 件のコメント
その他の回答 (1 件)
madhan ravi
2018 年 11 月 29 日
編集済み: madhan ravi
2018 年 11 月 29 日
Simple and easy solution:
xnew=sort([x y])
0 件のコメント
参考
カテゴリ
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!