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