how to combine intsructions of comparaison in one instruction

1 回表示 (過去 30 日間)
bay rem
bay rem 2016 年 1 月 4 日
回答済み: Azzi Abdelmalek 2016 年 1 月 4 日
i have 4 variables and i want to find whose are similar: example: a=23, b= 3, c=23, d=4, e=23... rather than compare each one: if (a==b), if (a=c)...if (b=a) ...if (c=b)...i would know if there is a way to remplace such instructions with one only instruction thank you

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 1 月 4 日
idx=ismember([b,c,d,e],a)

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by