compare answer with a range of numbers ?

1 回表示 (過去 30 日間)
salman hayat
salman hayat 2014 年 6 月 18 日
コメント済み: Azzi Abdelmalek 2014 年 6 月 18 日
i have answers 4,6,7,9 and want to compare them with a range of numbers 4:12 then i will extract that row which will meet this comparison true like i say if answer==4:12 then it does not work i have to ask if this answer is in the range of 4:12 if yes then it must work further
  2 件のコメント
salman hayat
salman hayat 2014 年 6 月 18 日
i have tried ismember ans it is working but if u have something better as an option plz tell
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 6 月 18 日
What is the problem with ismember?

サインインしてコメントする。

採用された回答

Matt J
Matt J 2014 年 6 月 18 日
編集済み: Matt J 2014 年 6 月 18 日
>> ismember([4 6 7 9 3],4:12)
ans =
1 1 1 1 0

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by