Hi,
You could write a piece of script to loop over the subranges and then perform linear fitting on the subrange respectively. Take an example:
int nRows = wks.nRows;
int nInterval = 5;
range raErr = col(3);
range rbErr = col(4);
for(int ii = 1; ii < (nRows/nInterval); ii++)
{
int nBegin = 1 + (ii - 1) * nInterval;
int nEnd = 5 + (ii - 1) * nInterval;
range ee = [Book1]Sheet1!(1,2)[$(nBegin):$(nEnd)];
fitlr iy:=ee;
raErr[$(nBegin)] = fitlr.aerr;
rbErr[$(nBegin)] = fitlr.berr;
}
You could find more details of fitLR X-Function here:
https://www.originlab.com/doc/X-Function/ref/fitLR
Regards,
Yuki
OriginLab