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
 interpolation script

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
asteria Posted - 03/30/2010 : 05:36:49 AM
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.
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 03/30/2010 : 10:35:30 AM
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

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