how to solve Unexpected MATLAB expression in the below line ?

조회 수: 4 (최근 30일)
Riya Bothara
Riya Bothara 2019년 2월 2일
댓글: Riya Bothara 2019년 2월 3일
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
Star Strider
Star Strider 2019년 2월 2일
To specify numeric vectors or matrices in MATLAB, use square brackets [] not parentheses ().
madhan ravi
madhan ravi 2019년 2월 2일
also instead of "==" use isequal()

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2019년 2월 2일
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'))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by