create a new matrix that extracts the values in matrix A as stipulated in matrix B

1 vue (au cours des 30 derniers jours)
Hello all,
I have a matrix A = [4; 8; 12; 16] where each row refers to a row in another matrix. For instance the other matrix is B = [12; 22; 7;45; 8; 52;48; 55; 34; 2; 14; 33; 2; 78; 14; 10; 18] and A(4,1) refers to the value 45 in B as it is the 4th value in the column.
My question is how can I create a new matrix that extracts the values in B as stipulated in A. For instance using the example above C = [45; 55;33;10].
Any suggestions would be very welcome!

Réponse acceptée

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 5 Déc 2019

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by