How to find a spesific value in a matrix?

조회 수: 2 (최근 30일)
Ararat Cetinkaya
Ararat Cetinkaya 2020년 5월 20일
편집: Ameer Hamza 2020년 5월 20일
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.

채택된 답변

Ameer Hamza
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개)

카테고리

Help CenterFile Exchange에서 Holidays / Seasons에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by