MATLAB: How to perform multivariable polynomial curve fitting

curveCurve Fitting ToolboxfittingMATLABmultivariablepolynomialStatistics and Machine Learning Toolbox

Hey Community! I am looking to perform a polynomial curve fit on a set of data so that I get a multivariable polynomial. I have successfully been able to fit a variable on an independent set using polyfit(). In my case, that was "voltage as a function of current." I want to be able to perform a fit that gives me a function for something like, "voltage as a function of current and temperature." Any ideas?
Cheers!

Best Answer

You can use the curve fitting toolbox (cftool) or the statistics toolbox (regress, LinearModel.fit, NonLinearModel.fit) to perform multiple linear regression.
If you don't have any of those toolboxes then you can set up your own optimization problem to fit your function as below: