How to find a spesific value in a matrix?
1 回表示 (過去 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!