Hi,
I have an array of data that is basically a plane placed at an angle, see attached image. I would like to find a plane or surface that fits this and subtract it out so that the features on the surface don't have a slant to them.
Thanks
Thanks! That worked.
You can use LinearModelFit:
data = Flatten[Table[{x, y, x + Sin[x + y]}, {x, 5}, {y, 5}], 1]; lmf[x_, y_] = Normal@LinearModelFit[data, {x, y}, {x, y}]; Plot3D[x + Sin[x + y] - lmf[x, y], {x, 0, 5}, {y, 0, 5}]