How to check a number is in a array or not?
조회 수: 2,480(최근 30일)
표시 이전 댓글
a=[8 9 6 5 3], I want to know 5 is there or not.
Guillaume 2017년 8월 29일
댓글 수: 2
Matthew Coile 2023년 2월 17일
Putri, you can just as easily use a variable. That is, ismember(x,a) would work as well, where the value of x is assigned earlier in the script.
Find more on Multidimensional Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!