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

Home » Public Forums » archive » problem in finding average for every 100 points in a data set.
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: problem in finding average for every 100 points in a data set. [message #87431 is a reply to message #87418] Sun, 02 February 2014 22:52 Go to previous message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
To get the means over blocks of 100 values, I'd reform 'B' ( 100 values
each line, thus 3,000 lines), and then get the means along each line:

bb = mean( reform( B, 100, 3000 ), DIM = 1 )



Am 01.02.2014 03:26, schrieb arsood:
> Hi,
> I have a data of B =300,000 and I want to find average for every 100 points. (eg, 0-100,101-200,201-300 and so on)
> I am using the following code
> pro at
> restore,'/home/coefficient.sav'
> nn = 300000
> BB = y3^2+y4^2
> B= sqrt(BB)
> bb = fltarr(long(nn-101))
> For i = long(0), long(nn-101),long(100) do begin
> bb(i) = mean(B(i:i+200))
> endfor
> print,bb
> end
> When I compile the program it prints zero along with nonzero values. so further I have o use another command for nonzero values
> print,bb(where(bb ne 0.0))
>
> Can please anybody tell me is my code correct and how can I print all non zero values in first place??
>
> Thanks
> ARSOOD
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: cgplotting points with error bars
Next Topic: extra lines in colorbar

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

Current Time: Wed Oct 08 13:55:24 PDT 2025

Total time taken to generate the page: 0.00486 seconds