Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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!

Akzeptierte Antwort

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH am 5 Dez. 2019

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays 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!

Translated by