Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.
2 次查看(过去 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!