change position values between two vectors
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
skysky2000
am 25 Dez. 2016
Kommentiert: Star Strider
am 25 Dez. 2016
Dear all; I have two vectors as seen below , and I want change position between them depend on vector b. The results should be: a=[73 312 135 192 0 122]; b=[2 1 5 4 6 3];
result=[ 312 73 0 192 122 135];
I tried result(b) = a; % and not work.
please help and Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 25 Dez. 2016
This works:
a=[73 312 135 192 0 122];
b=[2 1 5 4 6 3];
Result = a(b)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!