# How can I curve fit more than one variable

8 views (last 30 days)
Mohsen Salehi on 13 Mar 2020
Answered: Gaurav Garg on 18 Mar 2020
Hello,
I have three sets of x,y corresponding to three T values. For example for T1, I have x1,y1, x2,y2, ..... x8,y8 and the same for T2, and T3. The objective is to find a curve fit which is y=f(x,T). The nature of changes for y with respect to F is of the form (a.F^2+b.F+c) for a constant x and the nature of changes for y with respect to x for a constant F, is of the form AX^2+BX+C, however, the a and A and b, and B in these two equations are drastically different (positive and big value vs negative small value).
Please let me know which curve fitting command(s) I should try. I think I do have the toolkits needed as part of Matlab package.
Mohsen Salehi

#### 1 Comment

dpb on 13 Mar 2020
Looks like you would want to try to estimate independently or perhaps you could try the quadratic surface.
Be easiest to look at if you would attach .mat file with the data.
You have plotted the data, correct???

Gaurav Garg on 18 Mar 2020
You can use fit function (Curve Fitting Toolbox) to fit polynomials to data. Using fit, you can fit polynomials with degree less than or equal to 9, as in your case. You can read the documentation for any further understanding.
Moreover, MATLAB also provides you with an interactive application to fit the polynomial models. You can open the Curve Fitting app by entering cftool in MATLAB command window, and find the documentation here.