Generate row or column permutation
显示 更早的评论
Hi, I have row and column vectors x,y respectivily
assume N=3 , x={0.587 0.344 .712} , y={ 0.987 0.952 0.689 } after that the ascending order of x&y as shown Bx=sort(x); By=sort(y); the result for that
Bx={0.344 0.587 0.712}, By={0.689 0.952 0.987}
My question here >>>How taking the index of Bx&By from x&y to generate row and column permutation vectors to obtain the result as mm={2 1 3},and nn={3 2 1 }
采纳的回答
更多回答(1 个)
Image Analyst
2019-5-4
Try
[Bx, mm] = sort(x, 'ascend');
[By, nn] = sort(y, 'ascend');
3 个评论
huda ali
2019-5-4
Image Analyst
2019-5-4
You're welcome. Could you accept the best answer, and at least vote for mine?
huda ali
2019-5-4
类别
在 帮助中心 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!