Need an IF boolean that compares a number to all numbers in an array
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
回答 (1 件)
a = [1,2,3];
b = 2;
if any(b==a)
disp('b in a')
else
disp('b not in a')
end
Also, see the help for ISMEMBER. In this case it is not needed.
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!