Find logical and (&&) for string array
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Dyuman Joshi
el 24 de Feb. de 2023
Editada: Dyuman Joshi
el 24 de Feb. de 2023
1 comentario
Mikel Jimenez
el 25 de Feb. de 2023
Categorías
Más información sobre Variables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!