I am new in this community so forgive me if this is a sort of re-post. I am trying to convert this MATLAB script:
v_i = find(rect_xmin <= Xv & Xv <= rect_xmax & rect_ymin <= Yv & Yv <= rect_ymax)
in Mathematica. What it does (or at least it seems so to me) is to find the element positions in the two column vectors, Xv and Yv, satisfying the specified criteria. What I did so far is this:
intx = DeleteCases[ Flatten[Position[Xv, _?(xrectmin <= # <= xrectmax &)]], 1]; inty = DeleteCases[Flatten[Position[Yv, _?( yrectmin <= # <= yrectmax &)]], 1]; pointpos = Intersection[intx, inty];
But it results in a vector of 800 elements, while there should be 400. Could you help me to understand what is wrong? Thank you!