フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Comparing any of the matrix input

2 ビュー (過去 30 日間)
betul uslu
betul uslu 2019 年 12 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I have matrix 'classes
classes =
1
2
What i need is, if classes matrix include x it should say "Matrix 'classes' include x value" ,else "Matrix 'classes' do not include x value".
The challanging think is comparing x with any of the classes members without using for or while loops.

回答 (1 件)

James Tursa
James Tursa 2019 年 12 月 18 日
Hints: What does this result give you:
classes == x
Then look at this:
doc any
  3 件のコメント
James Tursa
James Tursa 2019 年 12 月 18 日
Type it into the command line and see what happens ...
You might also try:
doc ismember
betul uslu
betul uslu 2019 年 12 月 18 日
thank you for documnetation :D

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by