ismember and if not working
19 views (last 30 days)
hi, basically i want to check whether the array "A" contains specific value or not (0,2 and 3), if the array lack of specific value, i would like to add into the array and do some counting. Here is my code. Not error but i didnt into the elseif condition.
The specific value are stored in array_include_exclude array.
Hope my explainantion is clear. Please help to solve this. TQIA
array_include_exclude=[0 2 3]'
if A ismember(array_include_exclude)
elseif A ismember(array_include_only)
elseif A ismember(array_exclude_only)
Simon Chan on 22 Jul 2021
Please refer to the usage of ismember below, so location of variable A is not correct,
On the other hand, rearrange the order otherwise the first condition always satisfy and exit the loop.
A=[A; 3] % Modify to become a column matrix