I want to find multiple elements of a value in an array in Matlab code. I found the function mod and find, but these return the indices of elements and not the elements. Moreover, I wrote the following code:
x=[1 2 3 4];
if (mod(x,2)==0)
a=x;
end
but this does not work. How can I solve this problem?
a=xcopies the wholextoa