Message Boards Message Boards

0
|
5247 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Find equation of a plane based on array

Posted 9 years ago

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

Attachments:
POSTED BY: Cole Pierson
2 Replies
Posted 9 years ago

Thanks! That worked.

POSTED BY: Cole Pierson

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}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract