myfile = "xmatrix.sce";//determine the optimal values of the reaction rates k1 to k6 using the linregr function
folder = get_absolute_file_path(myfile);//get full path of file
infile = "xmatrix.csv";//Excel input file name
filename = folder + infile;//full file name
mydata = csvRead(filename);//read the input file
myheading = mydata(1,:);//use first row as heading
mydata(1,:) = [];//remove heading
    names = "y   x1   x2   x3   x4    x5   x6";//headings for each column of data
    fundef= "k1*x1 + k2*x2+k3* x3  +k4*x4 +k5* x5 +k6* x6";//regression moel
    dfundef = "x1  x2  x3  x4  x5  x6";//partial derivatives of function
    pdef = "k1  k2   k3   k4   k5  k6";//parameter names
    ydef = "y";//ydefinition
        best = ones(6,1) * 0.5;//use as starting values
    blower = zeros(6,1);//lower bounds
    bupper = ones(6,1);
    [b, stat] = nlinregr(mydata, names, fundef, dfundef, pdef,  "y", best, blower, bupper);//prform the linear regression using the linregr function
