Fitting multiple planes- multiple regression

Hi, I am trying to write a program to fit few planes to 3D data using multiple linear regression. Each plane would be best-fitted to a set of 3D data-points saved in single 2D array (x,y)=z, where x,y are X,Y coordinates in 2D Coordinate system and z is the height value in space. I would have a few of 2D arrays containing points, therefore few planes would have to be fitted in. The function computing regression would have to accept as input the list of 2D arrays: function [out1, out2, ...] = myfunction_multtiple_planar_fit(Input1_2D_array_1, Input2_2D_array_2, Input3_2D_array_3, ...) and also - Fit a plane to each array - Plot all data points and fitted planes on the same 3D-plot - Return plane equation for each fitted plane - Return centroid of each fitted plane (x,y coordinates and z [height] value)
I would more than grateful for your help!
Best wishes and many thanks, Robert

Answers (1)

If you have the Curve Fitting Toolbox, take a look at the surface fitting tool.
doc sftool %gui - fancy and fun
and
doc sfit

Categories

Asked:

Rob
on 4 Jan 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!