MATLAB: How to extract corresponding values of x-axis based y-axis values.

arrayfindindexingstatistics

Good day,
Could someone please help me on how to extract corresponding values of x-axis based on y-axis values?
x=[1,3,4,8,3,5,6,4,5,6,7,9]
y=[3,5,6,7,4,5,6,7,8,0,3,4]
I would like to extract the corresponding values of these elements; 5,6,7,4,5,6,7(values from y-axis) in x-axis.
I only know how to find a corresponding single value not multiple values.
Thanks

Best Answer

[z, zIdx] = mink(y,7);
xz = x(zIdx);