Saturday, September 08, 2012
PS 2.3 P17: solving parabola via matrix
The parabola:
goes through the points:y = ax + bx + cx^2
Find and solve a matrix equation for the unknowns (a, b, c)(x,y) = (1,4), (2,8), and (3,14)
== Solution == Given:a + b + c = 4 a + 2b + 4c = 8 a + 3b + 9c = 14Representing these equations as matrix in Octave:A = [1 1 1; 1 2 4; 1 3 9] b = [4; 8; 14]Solving x for Ax = b:A\bOutputs:2 1 1which means:a=2, b=1, c=1