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
 column max 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
kdsaransh Posted - 02/05/2015 : 04:38:57 AM
Hello,

i am doing some programming but stuck with the problem.

I have lots of workbooks and each workbook has a single sheet. Each sheet has suppose 7 columns. The 3rd col is set as x and all other as Y.
I want to do the following:
1. Differentiate the 5th and 7th col w.r.t. 3rd col (time)
2. Now i want to find the maximum value of the two differentiated col and find the corresponding value( 3rd col-time)
3.This time value should go into another workbook (sheet1) in second col and third col. I had filled the first col with some value.
4. Now finally, i want to do this for all the workbooks.

I had done some but don't know how to proceed further.

Thanks in advance.

// loop through all workbooks to change Vg as Y axis and time as X axis.

Doc -ef W
{
wks.col1.type =1;
wks.col3.type =4;
}
// loop through all workbook to diff col VD (col 5) using savitzy golay smooth
Doc -ef W
{
differentiate iy:=Col(5) smooth:=1 poly:=1 npts:=20;
}
// loop through all workbook to diff col VdummyD (col 7) using savitzy golay smooth
Doc -ef W
{
differentiate iy:=Col(7) smooth:=1 poly:=1 npts:=20;
}
newbook name:="time_vs_maxvalue" sheet:=1; // rename the new book and set no of sheet to 1
wks.colwidth = 8;// set all col width to 8

Col(1)[L]$="Gate Voltage";
Col(2)[L]$="Time_VDrain";
Col(2)[U]$="Sec";
Col(1)[U]$="V";
Col(3)[L]$="Time_VDummyD";
Col(3)[U]$="Sec";

Col(1)={10,20,30,40,50,60,100};




1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 02/05/2015 : 10:42:42 AM
// Set up a summary workbook, name will be stored in bkname$ by default
newbook name:="time_vs_maxvalue";
wks.colwidth = 8;// set all col width to 8
Col(1)[L]$="Gate Voltage";
Col(2)[L]$="Time_VDrain";
Col(2)[U]$="Sec";
Col(1)[U]$="V";
Col(3)[L]$="Time_VDummyD";
Col(3)[U]$="Sec";
Col(1)={10,20,30,40,50,60,100};

int Num = 1;

Doc -ef W
{
// Skip the summary workbook
if (%H == bkname$) {continue;}

// change Vg as Y axis and time as X axis.
wks.col1.type =1;
wks.col3.type =4;

// diff col VD (col 5) using savitzy golay smooth, result will be in the 8th column
differentiate iy:=Col(5) smooth:=1 poly:=1 npts:=20;

// diff col VdummyD (col 7) using savitzy golay smooth, result will be in the 9th column
differentiate iy:=Col(7) smooth:=1 poly:=1 npts:=20;

//find the max and assign the corresponding col(3) value to the new book
%(%(bkname$), 2, Num) = $(wcol(3)[list(max(wcol(8)), wcol(8))]);
%(%(bkname$), 3, Num) = $(wcol(3)[list(max(wcol(9)), wcol(9))]);
Num++;
}

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