How to save indices of a certain region of a matrix
Mostrar comentarios más antiguos
I have a matrix, let's say A
A = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16];
I have another matrix, let's say B
B = A(3:end,3:end);
This is how I can simple save B. But instead of saving the values of B. I want to save the indices of B that were in A.
Indices of B in A are 11,12,15 and 16.
How can I do it by using some matlab command?
Respuesta aceptada
Más respuestas (1)
Bhaskar R
el 3 de Mzo. de 2020
ind = find(ismember(A(:), B(:)))
1 comentario
Ahmad Hasnain
el 3 de Mzo. de 2020
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!