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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Smooth using average adjacent method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

chunkwan

Hong Kong
2 Posts

Posted - 06/16/2011 :  05:00:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

cpyang

USA
1406 Posts

Posted - 06/16/2011 :  1:01:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000