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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 column max value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kdsaransh

India
89 Posts

Posted - 02/05/2015 :  04:38:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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};




lkb0221

China
497 Posts

Posted - 02/05/2015 :  10:42:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
// 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++;
}

Edited by - lkb0221 on 02/05/2015 10:42:59 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000