Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jaah navi
am 3 Dez. 2019
Beantwortet: Bhaskar R
am 3 Dez. 2019
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu State-Space Control Design and Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!