How can I perform multivariable polynomial curve fitting?

44 ビュー (過去 30 日間)
Mitchell
Mitchell 2013 年 5 月 15 日
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!
  1 件のコメント
Abdullah Danyal Saeed
Abdullah Danyal Saeed 2016 年 11 月 24 日
Hi you can use mvregress for the above mentioned task.

サインインしてコメントする。

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 5 月 15 日
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:
  2 件のコメント
Mitchell
Mitchell 2013 年 5 月 15 日
So surface fitting gives me a 3D graph with x,y,z axis. From the looks of the help cftool file it seems like it is z as a function of x and y? Am I interpreting this correctly?
On another note, the temperature vector (call it y) will not be the same length as the current vector (call it x) since the experiment will be performed a discrete temperatures (say 5) and current will be ramped giving thousands of data-points. Will this be a problem?
Shashank Prasanna
Shashank Prasanna 2013 年 5 月 15 日
編集済み: Shashank Prasanna 2013 年 5 月 15 日
1) Yes Z = f(X,Y)
2) If you don't have same size data, you may have to interpolate.

サインインしてコメントする。

その他の回答 (2 件)

cr
cr 2013 年 5 月 15 日
I dont think basic Matlab has got that ability. You will need curve fitting toolbox to do surface fitting. See this link: http://www.mathworks.in/help/curvefit/surface-fitting.html
Regards.
  1 件のコメント
Mitchell
Mitchell 2013 年 5 月 15 日
I have full MatLab with pretty much every toolbox! Thank goodness for university licensing!

サインインしてコメントする。


David Graff
David Graff 2015 年 4 月 27 日
Use the excellent polyfitn package at http://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn . I love it and use it all the time.

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by