How to find a spesific value in a matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have an obstacles = [3,3; 3,4; 3,5; 4,3] matrix and I want to search [3,3] matrix in obstacles matrix and if this coordinates matches ı want to get 1 otherwise ı want to get 0 value.
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 5월 20일
편집: Ameer Hamza
2020년 5월 20일
obstacles = [3,3; 3,4; 3,5; 4,3];
TF = ismember([3 3], obstacles, 'rows')
Result
>> TF
TF =
logical
1
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!