sorting a matrix by another matrix

1 visualización (últimos 30 días)
Berfin Çetinkaya
Berfin Çetinkaya el 19 de Mayo de 2022
Respondida: David Hill el 19 de Mayo de 2022
For example we have a matrix A matrix
1 2 3 4 5
0.1 0.9 0.2 0.7 0.5
0.3 0.2 0.7 0.4 0.9
and there is one more matrix
3 5 4 1 2 Let's call this matrix B
Can we sort matrix A by B?
3 5 4 1 2
0.2 0.5 0.7 0.1 0.9
0.7 0.9 0.4 0.3 0.2
like this

Respuestas (1)

David Hill
David Hill el 19 de Mayo de 2022
A(:,B)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by