Solving large system of equations without explicit solution

Hello all,
I'm trying to develop a model in MATLAB for some of my data. I'm pretty much at my last point except what I thought would work, didn't. I have a set of 11 equations, each one a different datapoint evaluated at my input variables. Between these 11 equations, I have 8 constants that I need to solve for. MATLAB is irritated because I have more equations than variables and because there isn't an explicit solution. I know I won't be able to get values for my constants that satisfy all 11 perfectly. I thought "solve" would act like a regression and find the best fit given all 11 equations but evidently it doesn't. Is there a way to do what I want that I've missed?
Thank you for your time and assistance.

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 9 月 14 日

1 投票

Sorry, solve() is part of the symbolic toolbox, and does not handle regressions.
The symbolic toolbox tool that would at first appear to be most appropriate would be stats::reg .
However, this will not necessarily be any better than MATLAB's usual nonlinear regression tools, if you already know the equations.
Please note that stats::reg is part of the MuPad standard library, and does not have a direct interface to MATLAB itself. To use it, you will need to use either evalin(symengine,....) or else feval(symengine,'stats::reg',....)

3 件のコメント

B K
B K 2011 年 9 月 14 日
Thanks. I ended up reassembling my equations into a matrix by hand and just using A\b. I completely didn't think about just treating it as a matrix regression. If anyone knows a quick way to pull all the constants out of a symbolic expression so I don't have to keep doing this by hand I'd be much obliged, but thanks for helping me to think about it in a different way!
Walter Roberson
Walter Roberson 2011 年 9 月 14 日
What form are the symbolic expressions? If they are polynomials then the coefficients can be extracted using coeffs or sym2poly.
B K
B K 2011 年 9 月 14 日
It's a polynomial! Coeffs just made my life beautiful. Thank you so much!

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

カテゴリ

ヘルプ センター および File ExchangeSpline Postprocessing についてさらに検索

質問済み:

B K
2011 年 9 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by