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
 Copying interpolated y-intercept values

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
DrMorbid Posted - 08/30/2014 : 4:06:20 PM
Hello,

I have >10 graphs, each of which has a linear fit applied to it. The idea is to interpolate the fits, find the y-intercept value for each graph and copy all these y-intercepts to a new sheet in a new book. In other words, I need to find threshold voltages for many devices I've made. So far I have this code, but I have no idea how I can copy the r3(0) values for each graph to the new book. I've tried to use csetvalues and wxt x-functions, but failed. Thank you very much for help in advance.

doc -e W { // loop over all sheets in all books
if (%H != "Book1") { // omit the VTH book, which will gather all the y-intercepts
page.active$ = "Linear fit curve1"; // set the -5 V linear fit table to be active
range r1 = sheet$!col(1); // x-values of the linear fit
range r2 = sheet$!col(2); // y-values of the linear fit
range r3 = (r2, r1);
r3(0)=; // interpolated y-intercept of the linear fit to the original data
};
else break;
};
2   L A T E S T    R E P L I E S    (Newest First)
DrMorbid Posted - 09/01/2014 : 5:20:32 PM
Xie xie Kathy! This code worked well!
Kathy_Wang Posted - 09/01/2014 : 05:46:48 AM
Hi,

Perhaps it is easier to directly assign the value in r3(0) to a worksheet cell (row i and column j) within each loop using col(j)[i] = r3(0), so could be something like:


//First define a range variable as a column in the "new book"
range rr = [Book1]Sheet1!col(1); //Change book/sheet name or column index if needed
//Define an integer as a counter for loops
i = 1;
doc -e W { // loop over all sheets in all books
%H=;
if (%H != "Book1") { // omit the VTH book, which will gather all the y-intercepts
page.active$ = "FitLinearCurve1"; // set the -5 V linear fit table to be active, the default name is usually "FitLinearCurve1"
range r1 = !col(1); // x-values of the linear fit in active worksheet
range r2 = !col(2); // y-values of the linear fit in active worksheet
range r3 = (r2, r1);
r3(0)=; // interpolated y-intercept of the linear fit to the original data
rr[i] = r3(0);//Assign interpolated value to a corresponding cell
i = i + 1;
}
else break;
}


Kathy
Originlab

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