Asked by mohamed
on 1 Jun 2013

*No products are associated with this question.*

Answer by the cyclist
on 2 Jun 2013

Edited by the cyclist
on 2 Jun 2013

You could use either the regress() function or the LinearModel.fit() function.

doc regress

or

doc LinearModel.fit

for details.

In each case, you'll need to combine your X and Y values into one array (predictor variables) and use Z for the response variable.

Answer by Image Analyst
on 2 Jun 2013

I use John D'Errico's polyfitn(): http://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn

Opportunities for recent engineering grads.

## 0 Comments