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 of step-like function

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
muh Posted - 01/06/2016 : 12:31:37 PM
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 --
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 01/06/2016 : 4:21:24 PM
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

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