Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.
조회 수: 1 (최근 30일)
이전 댓글 표시
I having two matrices a and b
a=[ 0.0067;
1.8509;
0.0018;
0.0008;
0.0003;
0.1866;
0.0057;
0.0010;
0.0020;
0.0060;
0.0001;
0.3758]
b=[1;
2;
3;
4;
5;
6;
7;
8;
9;
10;
11;
12]
when i used the command
c=sort(a,'descend')
i get the following result
c=[ 1.8509;
0.3758;
0.1866;
0.0067;
0.0060;
0.0057;
0.0020;
0.0018;
0.0010;
0.0008;
0.0003;
0.0001]
Based on c the b matrix needs to be rearranged in descending order in the foll0wing manner.
b=[2;
12;
6;
1;
10;
7;
9;
3;
8;
4;
5;
11]
Could anyone please help me on this.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!