Find logical and (&&) for string array
Afficher commentaires plus anciens
Hi,
I normally use && operations with numeric arrays, like:
if arrayX==1 && arrayY ==2
z=10
elseif arrayX==2 && arrayY==1
z=20
end
Now, I'm trying to do the same thing with string arrays, but cannot find the way to do it correctly, the && operand does not work here. Example:
if arrayX=="Left" && arrayY=="Right"
z=10
elseif arrayX=="Right" && arrayY=="Left"
z=20
end
Any help with this very much appreciated.
Thanks.
Réponse acceptée
Plus de réponses (1)
Dyuman Joshi
le 24 Fév 2023
Modifié(e) : Dyuman Joshi
le 24 Fév 2023
1 commentaire
Mikel Jimenez
le 25 Fév 2023
Catégories
En savoir plus sur Variables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!