gauss elimination or inverse
Show older comments
Hi all,
I have a plynomial equation similar to the one iven below
Equation : ax^(n-1)+bx^(n-2)+.............+c=y
The equation must be satisfied for a set of x (say x1,x2,x3.....etc) and correspondig y (say y1,y2,y3......etc)
I need a suggestion to find the coefficient for the equation.(a,b,.....,c)
Should i use Gauss elimination method or simply do a inverse for the matrix [x] and find the solution.
Highly appreciate the responses.
Accepted Answer
More Answers (3)
Stephan
on 14 Jan 2019
1 vote
3 Comments
deep
on 14 Jan 2019
Bruno Luong
on 14 Jan 2019
How to work out this to get the coefficients correct?
Give up such high order fitting. Change the method.
deep
on 14 Jan 2019
Bruno Luong
on 14 Jan 2019
P = polyfit(x(:),y(:),n-1);
a = P(1);
b = P(2);
...
c = P(n);
3 Comments
deep
on 14 Jan 2019
Bruno Luong
on 14 Jan 2019
In general fitting polynomial with order >= 10 is not reliable.
deep
on 14 Jan 2019
Walter Roberson
on 14 Jan 2019
polyfit(x(:), y(:), n - 1)
5 Comments
deep
on 14 Jan 2019
Torsten
on 14 Jan 2019
What do you mean by "it does not result in the correct results" ?
deep
on 14 Jan 2019
Torsten
on 14 Jan 2019
If you insist on fitting your data with a polynomial of degree 15 (which is numerical nonsense in my opinion), use the centering and scaling option of "polyfit" as described here:
https://de.mathworks.com/help/matlab/ref/polyfit.html
deep
on 14 Jan 2019
Categories
Find more on Interpolation 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!




