You don't say which version of Origin you're using so I won't bother with an Origin C solution. The following LabTalk script will loop through all worksheets in the project and do what you want to each. With one modification... instead of creating a new worksheet for the average I just add a column to the old worksheet.doc -e W {
col(A)/=17.3; // normalize col A
del col(B); // delete col B
%W=%H; // remember wks name
wo -s 2 0 wks.ncols 0; // select cols 2 through last
wo -p 200; // create line plot (see worksheet command for other plot types);
win -r %H %WG; // rename plot by appending G to wks name
win -a %W; // activate worksheet
wo -c Average; // append a col named Average
col(Average)=wcol(2); // set col to col(2)
loop (i,3,wks.ncols-1) {
col(Average)+=wcol(i); // add all other Y columns to Average
};
col(Average)/=(wks.ncols-2); // divide by # of Y columns
wo -s wks.ncols 0 wks.ncols 0; // select last col (Average)
wo -p 200; // create line plot
win -r %H %WaveG; // rename plot
};
Mike Buess
Origin WebRing Member