am asking if there is a function in matlab which finds the first max and first min numbers compered to a number in an array
example :
if we have an array A = [1 2 3 4 5 6 7 8 9];
and the number is x=3.4;
How can we find whith a function (and not with a loop) and store the fist min and firts max of x in variables min_x max_x ?
desirable results:
min_x = 3
max_x = 4