The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 inefficient curve object?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
eno 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

1   L A T E S T    R E P L I E S    (Newest First)
rlewis 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000