Hi,

  $pos = which($x == $x->max)

should do the job for you.

Cheers,

  Rahman

On Mon, 2007-12-10 at 16:21 -0800, [EMAIL PROTECTED] wrote:
> Hi,
> 
> I have searched the documetation and came up empty on this one.  Is there a 
> PDL function that will return the position of a value  within a piddle ?  For 
> example:  I search for the maximum value within a one-dimensional vector:
> 
> $x is a 1-D piddle
> 
> $max = max($x);
> 
> $max will contain the largest value from $x. Is there a way to find out what 
> it's position is within $x without copying the PDL vector to a perl list and 
> looping ?
> 
> Rai
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> 


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to