Solving large system of equations without explicit solution

1 view (last 30 days)
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.

Answers (1)

Walter Roberson
Walter Roberson on 14 Sep 2011
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 Comments
Walter Roberson
Walter Roberson on 14 Sep 2011
What form are the symbolic expressions? If they are polynomials then the coefficients can be extracted using coeffs or sym2poly.
B K
B K on 14 Sep 2011
It's a polynomial! Coeffs just made my life beautiful. Thank you so much!

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!