Generate row or column permutation

2 ビュー (過去 30 日間)
huda ali
huda ali 2019 年 5 月 4 日
コメント済み: huda ali 2019 年 5 月 4 日
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 }

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 4 日
[c1,mn]=ismember(x,Bx);
[c2,nn]=ismember(y,By);
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 4 日
disp(mn);
huda ali
huda ali 2019 年 5 月 4 日
thanks soo much , the values of mm are available in reference i need how get these values

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2019 年 5 月 4 日
Try
[Bx, mm] = sort(x, 'ascend');
[By, nn] = sort(y, 'ascend');
  3 件のコメント
Image Analyst
Image Analyst 2019 年 5 月 4 日
You're welcome. Could you accept the best answer, and at least vote for mine?
huda ali
huda ali 2019 年 5 月 4 日
Thank you again and I vote for you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by