08-16-2019 01:03 PM
thanks a lot, that is super appreciated! like I said before, don't rush, eat first when you get home... this isn't really an issue till Monday.. but I need to lube up and prepare for Monday... LOL
08-16-2019 01:07 PM
For each point, x and y are known, so x, y , xy, x^2, etc. are just constants to be multiplied with your coefficients. This reduces to simple linear algebra once you calculate these terms for all valid points.
08-16-2019 03:43 PM
OK, here's a quick example based on my earlier work. It takes a 2D array, retains all non-NaN values and their indices, constructs the H matrix and does a fit to a second order 2D polynomial.
Note that the terms A..F are in slightly different order to your example, but I am sure you can deal with that ;))
08-19-2019 07:20 AM
You're a god among men. Ty so much! I'm going through it now to improve my understanding of how to tackle these things and apply them to future higher dimensional fits! Have a great day/week altenbach
08-19-2019 01:34 PM - edited 08-19-2019 01:38 PM
Should work with very few changes for any number of dimensions or polynomial orders (within reason!). Just stack more FOR loops and reshape to higher dimensions accordingly. 😄
You could probably write code that is scalable where everything adapts and only a change in the input and output dimensionality is needed. Maybe it could be made into a vim accepting DBL arrays of any number of dimensions. 😄