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
 interpolating

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
amorris Posted - 10/04/2005 : 3:38:05 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: WinXP

Hi everyone,

I have some data that looks like this:

X | Y
--------
... | ...
1.5 | 3.16687
1.6 | 3.45679
1.7 | 4.01003
1.8 | 4.45293
1.9 | 5.03876
2.0 | 5.51181
... | ...

I would like to know if it is possible to write a little script that would guess which X goes with a Y value of 5 (say). My data doesn't always look the same so I can't just fit it and then solve for x when y=5. Does anyone know how to do this?

Thanks!

Alexis
6   L A T E S T    R E P L I E S    (Newest First)
quickkk Posted - 10/07/2005 : 3:56:35 PM
Thanks rlewis, that was extremely helpful.

Cheers,

Alexis
rlewis Posted - 10/04/2005 : 5:50:33 PM
Compile and link the the following ...


void getY(string strCurveY,double xVal)
{
Curve crvMyCurve(strCurveY);
if(crvMyCurve.IsValid()==true)
{
double dXfromY = Curve_yfromX( &crvMyCurve, xVal );
printf( "X = %f, Y = %f\n", xVal,dXfromY);
}
}



Open a graph window in which the dataset is plotted.
Make the dataset of interest the active dataset.
Issue the command GetY(%C,0.25)



amorris Posted - 10/04/2005 : 4:59:11 PM
Thanks for the replies. Mike, I'll have to study those examples to help me get proficient with originC... As for the problem at hand, as you suggested rlewis, what I need is exactly provided by the OriginC function Curve_xfromY. The only problem is that I can't get it to work! I've tried compiling the example in the help file but it says that there is a variable declaration error. Here's the example from the help file:


double dXfromY;
Curve crvMyCurve( "Data1_A", "Data1_B" ); // Create Curve object
dXfromY = Curve_xfromY( &crvMyCurve, 0.25 ); // Get X value at Y=0.25
printf( "X from Y=0.25:\t%f\n", dXfromY );


Does anyone know what's wrong? I'm sorry to pester you all with these simple questions--I hope that I'm not too annoying.

Thanks,

Alexis
Mike Buess Posted - 10/04/2005 : 4:39:37 PM
There are several ways to interpolate in Origin. Here are a few others...

http://www.originlab.com/www/support/resultstech.aspx?language=English&ID=101

The Curve Spline Interpolate example at http://www.originlab.com/index.aspx?s=8&lm=243

http://www.originlab.com/forum/topic.asp?TOPIC_ID=844

http://www.originlab.com/forum/topic.asp?TOPIC_ID=4160

Mike Buess
Origin WebRing Member
rlewis Posted - 10/04/2005 : 4:06:34 PM
There is always the OriginC function ... Curve_yfromX ...
amorris Posted - 10/04/2005 : 3:56:55 PM
As an alternative, I can interpolate with a large number of data points (say 5000) with the origin analysis->interpolate command. What I need then is a way of asking origin which data point in the InterExtrap worksheet has a y-value which is closest to what I'm looking for...

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