Origin Version (Select Help-->About Origin): 7 Operating System: XP
I've designed a code for quicker working with regressions of my datas. I'm working with a variables to have the greatest posibilities. The datas of the polynom should be stored in the same worksheet as the original datas:
######################################
%t = %(1,@w); //selected worksheet
%w = %(%r,@col,selc1); //selected y-column
%j=fitx%w; //x-column for polynom %k=fity%w; //y-column for polynom work -v %j; // work -v %k; //
Your first two lines are confusing. My initial reaction is that it only makes sense if %r and %t are the same (wks), but it's hard to see what you're really trying to do. Could you elaborate?
Maybe it's better to add some more information: The sense of my script is to put the fitting datas in the same wks than the originals are.
My approach is: 1. I'm plotting the graph 2. I'm starting the script to make my fit.
Because the script is changing between graph and wks, I have to store the name of the wks. I'm doing this with "%t". With "%w" I'm catching the y-datas.
You can get the worksheet and column names from the string variable %C which always holds the name of the active dataset. (If your graph has more than one plots the active plot is checked at the bottom of the Data menu.) Try this...