I wrote a simple script to automate a task in origin, but the script fails after the first few columns. I'm rather confused.
The data looks like this: x1 y1 x2 y2 x3 y3 ...... col(45) 1 2 3 ... 3600
*not every column goes down to 3000 column 45 is special, in that it's a place to hold some values. for(i=2;i<45;i+2){ max = -100; for(j=1;j<3600;j++){ if(col($(i))[j]>max){ max = col($(i))[j]; } } col($(i)) /= max; col($(i)) = 1 - col($(i)); integrate col($(i)); col(45)[i/2] = integ.area; }
The preceeding code works for the first 10y columns, but then it stops working until the last column. There is a total of 44 columns, x and y alternatingly.
I suspect we'll need to see the worksheet before we can supply an answer. However, in the mean time I can give you a much faster way to obtain the maximum value of a column. Furthermore, it's independent of the number of rows in the column...