12-20-2008 09:18 AM
12-20-2008 12:29 PM - edited 12-20-2008 12:30 PM
Since each index contains two coordinates, your output needs to be a 2D array. There are many ways to do this, here's a simple version.
(Of course it is very dangerous to use this on floating point values (e.g. DBL), unless you can guarantee that you are dealing with exact value)
12-20-2008 12:41 PM - edited 12-20-2008 12:45 PM
You could also reshape your array to 1D, search the 1D array, and then calculate the 2D indices. It's probably not worth the extra code. 😉