Azzera filtri
Azzera filtri

How to find a spesific value in a matrix?

3 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Ameer Hamza
Ameer Hamza il 20 Mag 2020
Modificato: Ameer Hamza il 20 Mag 2020
obstacles = [3,3; 3,4; 3,5; 4,3];
TF = ismember([3 3], obstacles, 'rows')
Result
>> TF
TF =
logical
1

Più risposte (0)

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by