searching for vector values in a matrix
이전 댓글 표시
Hi, I have a vector with 3 specific values and I want to find their indices in a matrix.
댓글 수: 1
James Tursa
2015년 4월 28일
What are the dimensions of the matrix? Do the values have to be next to each other in the same row or column?
채택된 답변
추가 답변 (1개)
Image Analyst
2015년 4월 28일
If yourVector is an integer valued vector or a floating point vector with values that are multiples or divisors of 2, then try
firstIndex = find(yourVector == firstSpecificValue);
secondIndex = find(yourVector == secondSpecificValue);
thirdIndex = find(yourVector == thirdSpecificValue);
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!