Coordinates matrix to new Matrix
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Greetings, I have a matrix size of 50 to 50 named Map1 (structured your entire library of Matlab).
I want to do this: go through all the map [i] [j] (As mentioned cordite are named path matrix). And take the value and enter a new matrix
Answers (1)
Azzi Abdelmalek
on 3 Jan 2016
Edited: Azzi Abdelmalek
on 3 Jan 2016
Look at this example
M=randi(50,5,5) % Your data
map=[2 3;4 1;3 2] % The locations
idx=sub2ind(size(M),map)
out=M(idx)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!