Access matrix location on one matrix with the data location on another matrix
이전 댓글 표시
I have two matrix say A & B if I have data stored in A and the data location of desired values in B how could I access Values of matrix A who are located at locations B.
채택된 답변
추가 답변 (1개)
madhan ravi
2019년 6월 21일
Probably you want:
idx = setdiff(1:numel(A),B);
A(idx) = 0;
댓글 수: 2
Rohan Mehta
2019년 6월 21일
madhan ravi
2019년 6월 21일
편집: madhan ravi
2019년 6월 21일
Beware this method works even if A is a matrix more than 1 dimension unlike the other.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!