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

Home » Public Forums » archive » row calculation in a 2D array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: row calculation in a 2D array [message #12702 is a reply to message #12604] Mon, 31 August 1998 00:00 Go to previous messageGo to previous message
Richard G. French is currently offline  Richard G. French
Messages: 65
Registered: June 1997
Member
I don't know what the execution time penalty is for doing this,
but I have often used

avg=reform(rebin(A[3:6,*],1,10))

not sure if the reform is essential in this example but in general
it is useful for making sure a vector is a one-D array.
Dick French


>>
>> I want to perform the same operation on each sub-row in a 2D array.
>> Say I want to calculate the mean of element 4-7 in each row of a 10x10
>> array, and store the result in a 10 element-vector, where each element holds
>> the mean from the respective row
>>
>> how is this done the smartest way, without using time-consuming loops?
>>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: how to find number of lines in an ASCII file?
Next Topic: Re: Variable Tick Scaling

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

Current Time: Sat Oct 11 03:56:53 PDT 2025

Total time taken to generate the page: 1.03874 seconds