I want to extract specific data from a matrix and organize in another matrix
Ältere Kommentare anzeigen
Hi-
I have a 3x3 matrix A=[1 2 3; 5 7 9; 4 6 8] and want to use the digits to extract data from the row and column they represent in another 9x9 matrix B=[0 2 4 3 2 4 5 2 7; 2 0 4 3 2 4 5 2 7; 3 4 0 9 8 7 4 3 2; 9 4 3 0 2 3 9 8 7; 3 2 1 9 0 9 3 2 4; 9 4 5 6 3 0 9 3 2; 3 2 4 5 6 7 0 3 9; 4 3 2 5 7 6 4 0 9; 4 3 4 5 4 3 2 5 0] and place the answer in matrix C. C should be equal to [B(1,2) B(1,3) B(2,3); B(5,7) B(5,9) B(7,9); B(4,6) B(4,8) B(6,8)]. I hope this makes sence. It should walk the A matrix finding every interaction for the row and col coordinates to extract from B. Thanks!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!