Hi all!
I’m trying to find nearest to “a” elements of arrays “m5”,“m6” and take its indexes (in this arrays) for some computations (not connected with this problem).
After some attempts, i find a solution:
The second index is ok, but there is
the question:
Maybe, exist a more simple construction (in my variant - too many functions & brackets).
(I want to see index without any figure brackets - for next step computations)…
If you could edit your posting to include a small example with all the data, what the solution should be and why then it might be more likely that you would get good answers more quickly.
To get the position(s) you can use Nearest[values->Range[Length[values], a]. That should allow you to avoid Position. No idea why Flatten is needed without seeing your actual example.