How to use values of a vector as indices for a matrix
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I have the 20x20 matrix M and the m-by-3 matrix (two column vectors) L.
The values in the 1st and 2nd column of matrix L are to be used as the m and n indices for the matrix M. I attempt to get the corresponding values in M and insert them into column 3 as follows:
L(:,3)=M(L(:,2),L(:,1));
However, this does not work. What is wrong?
댓글 수: 0
답변 (1개)
이 질문은 마감되었습니다.
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!