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
 Smooth using average adjacent method

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
chunkwan Posted - 06/16/2011 : 05:00:33 AM
Hi. I am new to labtalk and hope somebody can help me out with this. I will appreciate your help a lot.

So, by looking up the manaul, it said I should use the following code for smoothing a curve:
layer -c; // Count the number of data plots in the layer and save result in variable "count"
string gname$ = %H; // Get the name of this Graph page
newbook na:=Smoothed; // Create a new book named smooth - actual name is stored in bkname$
wks.ncols=0; // Start with no columns
loop(ii,1,count)
{
range riy = [gname$]!$(ii); // Input Range refers to 'ii'th plot
range roy = [bkname$]!($(ii*2-1),$(ii*2)); // Output Range refers to two, new columns
smooth iy:=riy meth:=sg poly:=3 oy:=roy; // Savitsky-Golay smoothing using third order polynomial
}

However, this is only the Savitsky-Golay method. What code should I use to replace the last line if I want to do average adjacent method?

Again, thanks for any help. =)

Kwan
1   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 06/16/2011 : 1:01:43 PM
You can type

smooth -h

in the script window to get detailed usage info, but to use Adjacent Average, you should use aav, like (if number of points = 6)

smooth iy:=riy meth:=aav npts:=6 oy:=roy;


CP

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