how to solve Unexpected MATLAB expression in the below line ?

3 visualizaciones (últimos 30 días)
if(color ==(255 255 255 )color || color==(0 0 0) || color==(255 0 0) || color==(205 133 63) || color==(101 67 33) || color==(0 134 139) )
Error shows in green and blue value of color white.
  2 comentarios
Star Strider
Star Strider el 2 de Feb. de 2019
To specify numeric vectors or matrices in MATLAB, use square brackets [] not parentheses ().
madhan ravi
madhan ravi el 2 de Feb. de 2019
also instead of "==" use isequal()

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 2 de Feb. de 2019
map = [255,255,255;0,0,0;255,0,0;205,133,63;101,67,33;0,134,139];
if any(ismember(color,map,'rows'))

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by