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
 interpolation script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

asteria

USA
Posts

Posted - 03/30/2010 :  05:36:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 7.5 SR6
Operating System: XP

I have a worksheet like this:
A B
1 0.2
2 0.5
3 -
4 0.3
5 -
6 0.1
...

I need a script to do interpolation and find the missing value, preferably using cubic spline.

Anyone can help with this? I really appreciate it.
Thanks.

greg

USA
1378 Posts

Posted - 03/30/2010 :  10:35:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think you are out of luck with 7.5 and the reason is that 7.5 focuses on the X values when interpolating and if an interpolated X value is in the original Y dataset then we just return the original Y. 8.x can do what you want easily.

To see the problem in 7.5, try this (Warning! Destructive script):
// BEGIN SCRIPT
doc -s;
doc -n;
col(1) = {1,2,3,4,5,6};
col(2) = {.2,.5,0/0,.3,0/0,.1};
wo -a 2;
wks.col3.type = 4;
col(3) = data(1,6,.1);
wo -s 2;
wo -p 202 linesymb;
set %C -z 24;
PAGE.CONNECT=1;
set data1_b -l 9;
sec -p;
Data1_D = Data1_B(Data1_C);
layer -i Data1_D;
legend;
// END SCRIPT

Note two things:
(1) Even though column D has many interpolated values, there are still missing values at X = 3 and X = 5.
(2) When you increase the X resolution, you modify the parameters defining the Spline.

Here are the differences between 7.5 and 8
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