How to use matlab to find unknowns in nonlinear equation at a certain readings

1 view (last 30 days)
Hello everybody.
Assume I have the following equation: Y = a0 + a1*log(x1) + a2*log(x2) + a3*x3 + e. The unknowns here are a0, a1, a2 and a3. I need to find the values of these unknowns in order to minimize the value of error, e. Note that I have a matrix of readings such as: data = [0 5 10 15 20;1 2 3 4 5;6 7 8 9 10;11 12 13 14 15], where x1=data(1), x2=data(2), x3=data(3), and y=data(4). How can I find these unknowns using MATLAB and how can I decide that these values of unknowns are best fit or not.

Accepted Answer

Matt J
Matt J on 26 Apr 2015
Edited: Matt J on 26 Apr 2015
Looks like a linear equation to me, linear with respect to the unknowns a0...a3, that is. Just use mldivide(). It is known to give the least squares error.

More Answers (0)

Categories

Find more on Optimization in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!