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
 X values for which Y close to a target value

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
flombone Posted - 04/24/2013 : 09:40:32 AM
Origin Ver. and Service Release: 8 SR5
Operating System: Windows XP Professional

Hello everybody,

I am trying to write a LabTalk script able to calculate few critical parameters of a large set of data. These represent a lot of S-shaped curves that span from ymin to ymax. I am having problems to calculate the x value for which y gets closer to the mean value (ymax+ymin)/2.
Do you have any idea about how to calculate it?

Thanks in advance!
1   L A T E S T    R E P L I E S    (Newest First)
JacquelineHe Posted - 05/03/2013 : 06:28:52 AM
Hi,
I assume that the X and Y values are in the column 1 and 2. You can try to use this script to get the value:

wks.addcol();// add a new column
double bb=max(col(2)); 
double cc=min(col(2));

int aa = wks.ncols;
wcol(aa)=abs(col(2)-((bb+cc)/2));

limit wcol(aa); // Find min value in the new column using limit command
double dd = col(1)[$(limit.imin)]; // limit.imin -- Corresponding index for minimum Y value. 

dd=;

Please refer to this page about the limit command.
http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/LabTalk/LabTalk/Limit_%28command%29.html

Thanks,

Jacqueline
OriginLab

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