I'm trying to build a polynomial fit across large arrays of data (5Mpixel imagery) across a number of different sheets (each sheet is a frame). I'm using LINEST to generate the coefficients for a 4th order polynomial:
A Column B Column
$A$2 $B$2
$A$3 $B$3
$A$4 $B$5
$A$5 $B$5
$A$6 $B$6
X^4 Coefficient =INDEX(LINEST($A$2:$A$6,$B$2:$B$6^{1,2,3,4}),1)
X^3 Coefficient =INDEX(LINEST($A$2:$A$6,$B$2:$B$6^{1,2,3,4}),1,2)
X^2 Coefficient =INDEX(LINEST($A$2:$A$6,$B$2:$B$6^{1,2,3,4}),1,3)... etc
This only works when all the data is on a single sheet. If I want to pull corresponding imagery cells from multiple sheets, as if for example $A$2 instead resides at 'sheet 2'!$A$2 and $A$3 resides at 'sheet 3'!$A$2 etc,
X^4 Coefficient =INDEX(LINEST('sheet 2'!$A$2:'sheet 3'!$A$2:'sheet 4'!$A$2:'sheet 5'!$A$2:'sheet 6'!$A$2,$B$2:$B$6^{1,2,3,4}),1)
throws a reference error. Maybe I shouldn't be separating the elements with a colon, but it doesn't like a comma either. I'm thinking of doing this in Matlab, but I have a number of routines in Excel that make other pieces of this analysis very easy - just this one hitch. VBA perhaps? I can't possible go through the 5M pixels per image * X images and pull all of the individual cells element by element onto a single sheet.
Bookmarks