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
 Call Find X/Y from LabTalk 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
J.S.Schulte Posted - 06/12/2024 : 02:29:57 AM
Origin Pro 2024b and SR0
Operating System: Windows 10

Hello, I have written a LabTalk script in which I perform a curve fit with 2 exponents (expdec2) on imported data via nlfit. Everything works fine so far. However, I would like to subsequently calculate certain x-values using known y-values with the fitted curve. If you call up the nlfit function via the menu function, you can activate the Find X/Y function as an option, enter the corresponding y-values in the generated spreadsheet and read out the y-values. How can I activate/call the Find X/Y function within a LabTalk script?

Translated with DeepL.com (free version)
2   L A T E S T    R E P L I E S    (Newest First)
J.S.Schulte Posted - 06/14/2024 : 04:59:16 AM
Hi Nicholas,

I am looking for the Find X/Y function/table documented here:
https://www.originlab.com/doc/en/Quick-Help/Find-XY-Table

You can activate the function as an option in the NLFIT dialog.
After the adjustment, the FitNLFindXfromY1 sheet is generated, in which you can enter defined y-values. The corresponding X values are then calculated based on the fit parameters.

However, it is not documented if and how I can enable this option using a LabTalk-script.

My current script looks like this:
range rP=col(2);
peakindex=list(max(rP),rP);
range fitX=col(1)[peakindex:end];
range fitY=col(2)[peakindex:end];
nlbegin iy:=(fitX,fitY) func:=expdec2 nltree:=ParamTree;
nlfit;
nlend 1;

The script performs a curve fit from the peak to the end of my data. I then want to use the Find X/Y function to calculate X values from certain Y thresholds. To do this, however, I need to be able to call the Find X/Y function.

Best,
NicholasSupport Posted - 06/12/2024 : 11:43:38 AM
Hello,

I believe you are looking for the interp1 function: https://www.originlab.com/doc/X-Function/ref/interp1

https://www.originlab.com/doc/en/Origin-Help/FitRef-FindVal-StandardCurve

The script works for interpolating both X from Y and Y from X values. Just swap your Y values and X values. The code may look something like this:
interp1 -r 2 ix:=[Book1]Sheet1!D iy:=[Book1]Sheet1!(B,A) method:=linear option:=extrap;

The above example would interpolate X values from Y values assuming I had the columns set up like this: col(A):X1, col(B):Y1, col(C):X2 (blank), col(D):Y2 (values at which X2 will be interpolated)

Let me know if this is successful.

Best,


Nicholas G.
nicholas@originlab.com
OriginLab Technical Support Team

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