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
problem in finding average for every 100 points in a data set. [message #87418] Fri, 31 January 2014 18:26 Go to previous message
arsood is currently offline  arsood
Messages: 1
Registered: January 2014
Junior Member
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 11:28:52 PDT 2025

Total time taken to generate the page: 0.00440 seconds