Info
此问题已关闭。 请重新打开它进行编辑或回答。
Comparing any of the matrix input
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
James Tursa
2019-12-18
Hints: What does this result give you:
classes == x
Then look at this:
doc any
3 个评论
James Tursa
2019-12-18
Type it into the command line and see what happens ...
You might also try:
doc ismember
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!