“per column” max value & location

From a 2D wave I would like to get not only the max of each column, but also its location.

The former I can do using:
ImageTransform/METH=1 xProject mat2D

But for the later I have not found a solution WITHOUT looping over single columns.
Are there any other options?
Output should be a 1d wave analogous to V_maxcolloc from WaveStats.

I would like to avoid an additional (nested) loop here, because of computation time, readability, …

Thanks for your help.
I don't know of a method to acquire the max location for columns in a 2D wave other than looping and using wavestats (but I'm not exactly an expert).

Why would it require an additional loop? A single loop performing wavestats on each column (copied into a temporary 1D wave) will provide max value and location.
proland wrote:
Why would it require an additional loop? A single loop performing wavestats on each column (copied into a temporary 1D wave) will provide max value and location.

...in addition to the loops in my code...
All other operations I can perform "in parallel" using MatrixOP.
The only bottleneck is this 1d search for the maximum location.
I thought maybe I am missing something here...
peng wrote:
proland wrote:
Why would it require an additional loop? A single loop performing wavestats on each column (copied into a temporary 1D wave) will provide max value and location.

...in addition to the loops in my code...
All other operations I can perform "in parallel" using MatrixOP.
The only bottleneck is this 1d search for the maximum location.
I thought maybe I am missing something here...


MatrixOP could do much of the job but it does not provide two different results (max and maxLoc) at the same time. I think the OP would benefit from IP7 WaveStats/C that lets you obtain the results on a column-by-column basis. In the meantime I can only suggest looping through the wave, extracting a column and performing WaveStats/M=1 as in:
for(i=0;i<nCols;i+=1)
  MatrixOP/FREE aa=col(matrixWave,i)
  WaveStats/Q/M=1 aa
 // now put the relevant v_ somewhere
endfor


A.G.
WaveMetrics, Inc.