comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » how to get the index of the maximum element in each row for a 2D matrix efficiently
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
how to get the index of the maximum element in each row for a 2D matrix efficiently [message #36301] Fri, 29 August 2003 10:34
xje4e is currently offline  xje4e
Messages: 18
Registered: February 2002
Junior Member
Hi, there,

Suppose we have a 2D dimension matrix A(i,j), I want to get the index
of the max element in each row.

Basicly, we can do a for loop on each row, then use 'max' function to
get the index for each row. But for a matrix having many rows, that
will be pretty slow-->not efficient. Is there a function that can
return what I want if I input a 2D matrix.

In the previous version, 'total' function can only get the total
values of the whole matrix. Now it can get the total values on each
dimension by setting the keyword 'dimension'.

So how is 'max' working?

Best regards,

Jin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: map_patch and triangulating satellite images
Next Topic: graphics formats, triangulisation & coordinate systems

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 14:26:17 PDT 2025

Total time taken to generate the page: 1.54321 seconds