A common German phrase reads: “not to see the wood for the trees”. I guess it is also know to non-German speakers? I just found this very trivial and easy Matlab command line, which makes my equivalent lines look very stupid and complicated:
a= [1; 4; 6; 8; 12]; k=9;
[min_difference, array_position] = min(abs(a – k))
These treasures make my day!