MATLAB: How to find value in a matrix within certain range of certain step

find rangefliterstep

I have a matrix like this [1,2,3;4,5,6;7,8,9]
I want to find value between 3 and 6, which having step 2, like this [3:6:2]
I know how to find value between 3 and 6
But how do I filter it under certain step?
(The answer should return 3,5 for me)
Edit: and I want to know the index of the answer in matrix

Best Answer

intersect(3:2:6, thematrix)