There are a number of ways to go about it:
(1) Probably the simplest is to use:
whichND($a == $a->min)
(2) For 2-D data max2d_ind can be used on the negative:
$neg_a = -$a;
$neg_a->max2d_ind;
(3) You can also use the minimum_ind as well but you'll need
to flatten the data into 1-D first and then convert the
resulting index from 1-D back to the original PDL 2-D
coords:
one2nd($a,$a->flat->minimum_ind)
Hope that gets you going....
--Chris
On 5/20/2017 16:44, keith hirsh wrote:
> Hi all,
>
> I have a 100 x 100 element piddle $a with a global minimum and can
> find it using the min function min($a).
>
> My problem is that I have been unable to find a function to extract
> the x,y indices for the global minimum value returned by the min
> function. I want to avoid using for-loops.
>
> I see that the minimum (not min) function has an associated index
> function (e.g., minimum_ind), but the minimum function returns a
> piddle with the minimum value of each row vector, not the one global
> minimum of the piddle.
>
> Thanks for any suggestions!
> Keith
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general