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 Center および File ExchangeNumerical 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