Rebuild a matrix from indices
Mostrar comentarios más antiguos
Hi everyone! After I extracted the indices from a matrix, I´d like to rebuild it and store other data in the places marked by the indices. For example, if I had
A = [0 2 2 0 0 ; 2 0 0 2 2 ; 0 2 0 2 2 ; 0 0 0 2 2 ; 2 2 0 2 2];
[i,j] = find(A==2);
I get the indices where the 2's are in the matrix (i for rows and j for columns). What I'm trying to do is change the value of the 2's and store data in that positions. That data has the same indices i and j (they are coordinates UTM). I'm working on a big matrix, around 5000x5000. Thank you.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrices and Arrays 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!