Find logical and (&&) for string array
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (1)
Dyuman Joshi
il 24 Feb 2023
Modificato: Dyuman Joshi
il 24 Feb 2023
1 Commento
Mikel Jimenez
il 25 Feb 2023
Categorie
Scopri di più su Variables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!