MATLAB: How to find X value of given Y close to zero

x value of given y

How to find the value of Y more close to zero first (note Y consists of both positive and negative numbers) and then find the corresponding X value ? Many thanks in advance.
Lets say I have X and Y given by
X=[-51 -41 -31 -21 -11 1 11 21 31 41]
Y=[0.003 -0.002 0.004 0.0002 -0.05 0.0003 -0.001 0.006 0.01 0.0012]

Best Answer

[val,idx] = sort(abs(Y)) ;
Y(idx)
X(idx)