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 of step-like function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

muh

France
14 Posts

Posted - 01/06/2016 :  12:31:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello. I am trying to interpolate a step-like function. It stays constant for some range of X, then jumps to a new value, stays constant etc. Usual procedure seem to work very poorly. Here is example. Is there a workaround?

X Y Interpolated value just to the left of a point
F= col(y)(col(x)-0.001)
0.000000 10.67 -0.69
0.519985 10.67 10.67
0.519985 2.05 10.67
0.530043 2.05 10.67
0.530043 -2.32 10.67
0.531418 -2.32 10.67
0.531418 -3.37 10.67
0.669557 -3.37 10.67
0.669557 78.66 10.67
0.694520 78.66 10.67
0.694520 -27.05 10.67
0.718891 -27.05 10.67
0.718891 0 10.67
1.609484 0 10.67
1.609484 -0.53 10.67
8.549832 -0.53 10.67
8.549832 -0.96 10.67
8.552062 -0.96 10.67
8.552062 -0.76 10.67
8.552408 -0.76 10.67
8.552408 -0.69 10.67
-- -0.69 --

Hideo Fujii

USA
1582 Posts

Posted - 01/06/2016 :  4:21:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi muh,
Not sure if I understand correctly, but it seems you simply need to locate the position of the given
X value on the X axis, then read out the Y level. Can you try the following method:



Here, I inserted a dummy Y column(col(D1)) filled with row numbers, apply the "Interpolate/Extrapolate
Y from X"(interp1) for the specific X positions (col(D)), get the location's row# (col(F)), and finally
read out the Y value at the location (col(G)).

You can script for these steps easily. Hope this helps.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 01/06/2016 5:50:59 PM
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