.I successfully found the coefficients for the quadratic function as follows.
function [a2,a1,a0] = QuadraticRegression (x,y)x=[10 15 25 40 50 55];y=[94 116 147 183 215 220];n = length (x)sx = sum(x)sy = sum(y)sx2 = sum(x.^2)sx3 = sum(x.^3)sx4 = sum(x.^4)sxy = sum(x.*y)sx2y= sum(x.*x.*y)A = [ n sx sx2; sx sx2 sx3;sx2 sx3 sx4]b = [sy;sxy;sx2y]w= A\ba2 = w(3)a1 = w(2)a0 = w(1) % code
end*func(y) = -0.0170 x.^2 + 3.8870 x + 59.0062
now i'm suppose to fit the above data into a power function as follows : y = Q (x.^M) Where Q and M are coefficients.
I went through the book https://books.google.com/books/about/Numerical_Methods_for_Engineers_and_Scie.html?id=gMrMBQAAQBAJ&printsec=frontcover&source=kp_read_button#v=onepage&q&f=false
and went through Youtube and google before i posted my question here. I see no method mentions in the any of the resources. Please give me some clues. Thanks
Best Answer