Author |
Topic  |
|
eno
Japan
34 Posts |
Posted - 12/01/2005 : 10:58:50 PM
|
Origin Version :7.5SR5 Operating System:Win XP Pro SP2
Hi all,
I have a dataset that has 3,000,000 rows in col(b) (col(a) is data&time), and want to do an adjacet average on col(b) using the following script. However, it is extremely inefficient (it may fall into an infinite loop). When I do not use %o!wks.maxrows for loop, the situation can not be improved.
What's a problem?
%o="data1"; %p="_b"; time=5; spts=3*6*60; win -t D; %w=%h; loop(ii,time*6*60+1,%o!wks.maxrows) { bigini=ii-time*6*60; endi=ii-1; curve.data$=%o%p; curve.result$=%w%p; curve.i1=$(bigini); curve.i2=$(endi); curve.smoothpts=$(spts); curve.adjave(); %(%o,3,ii)=%(%w,2,%w!wks.maxrows); clearworksheet %w; }; win -cd %w;
eno
|
|
rlewis
Canada
253 Posts |
Posted - 12/02/2005 : 06:26:31 AM
|
Given the size of your dataset, investing in an an OriginC solution may be worthwhile ....
The OriginC function "smooth" should do the trick |
 |
|
|
Topic  |
|
|
|