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++; } |
|
|