function [index]=searchclosest_m(f,value);
% 
% Jun 20, 2016: Careful when using this function
% Noticed for value=NaN it returns index=1
[c index] = nanmin(abs(f-value));
closestValues = f(index); % Finds first one only!
end