Coordinates matrix to new Matrix

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 1월 3일
편집: Azzi Abdelmalek 2016년 1월 3일

0 개 추천

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)

이 질문은 마감되었습니다.

태그

질문:

2016년 1월 3일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by