Do you want to perform linear fit on 6 points exacted from each worksheet? It means 19 fitting procedures will be required. If I did not get you wrong, the following Labtalk script should be able to do the job. You can paste it into the Script Window and execute.
create worksheetname -s 19;
jj=1;
doc -e w
{
worksheetname[$(jj)]$=%h;
jj++;
};
//Create a new worksheet to hold the data
create FitData -wn 6;
worksheet -a 18;
col(1)=data(1,6);
//Create a new worksheet to hold the result
create FitResult -wn 19 Index Slope Error;
col(1)=data(1,19);
//Copy data
for (ii=1; ii<jj; ii++)
{
%j = worksheetname[$(ii)]$; //The name of worksheet
%a = %j!wks.col$(1).name$; //The name of Column 1
%a = %j_%a;
%b = %j!wks.col$(2).name$; //The name of Column 2
%b = %j_%b;
%z= FitData!wks.col$(ii+1).name$;
%z=FitData_%z;
%z[1]=%a[2];
%z[2]=%b[2];
%z[3]=%a[4];
%z[4]=%b[4];
%z[5]=%a[5];
%z[6]=%b[5];
win -t plot scatter; //Create a new graph page
layer -i %z ; //add data to layer
layer -a; //rescale axes to show all data
lr %z;
FitResult_Slope[$(ii)]=lr.a;
FitResult_Error[$(ii)]=lr.sd;
};
//Plot the result
win -t plot scatter; //Create a new graph page
layer -i FitResult_Slope ; //add data to layer
layer -a; //rescale axes to show all data
win -t plot scatter; //Create a new graph page
layer -i FitResult_Error ; //add data to layer
layer -a; //rescale axes to show all data
Deanna
OriginLab GZ Office