How to fit a linear function in two variables?

Hi,
I am trying to fit a simple superposition function between three arrays - Y[ ]=a*X1[ ]+b*X2[ ] to determine the best fit using two numbers a and b.
I have tried manually varying the values of a and b (to get the sum to be closest to Y) though I would like to obtain exact values and some sense of the error.
I have tried using some of the functions like lsqcurvefit and lsqlin though I have not been able to figure out a way to vary two constants at once.
I would really appreciate if someone could share some ideas to solve such a problem. Thank you!

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

标签

提问:

2013-5-15

Community Treasure Hunt

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

Start Hunting!

Translated by