"Aumi " <ak987@mst.edu> wrote in message <gis1il$d3l$1@fred.mathworks.com>...
> I do not understand your reply ?
> ......
I interpreted your question to mean that you wanted to adjust the three coefficients, A, B, and C, so as to minimize the mean square difference between the elements in your 'alpha' vector and the corresponding elements of the vector A*sqrt(f)+B*(f)+C*(f.^2). According to your statement the arrays 'alpha', 'f', and therefore 'A*sqrt(f)+B*(f)+C*(f.^2)' are each column vectors containing 6401 elements. If you subtract the first of these from the third, square these differences, and then find the mean value of these squares, you would presumably want this mean value to be a minimum. If you could get it down to zero, all the better.
That is exactly what the backslash '\' operator does in matlab. When the number of equalities (6401) exceeds the number of unknowns (3), it adjusts these unknowns so as to minimum the mean square differences. In this case on the left side is a 6401 x 3 matrix of values and on the right side a 6401 by 1 column vector and the 3 x 1 answer of [A;B;C] which it delivers is intended to satisfy the requirement
alpha = [sqrt(f),f,f.^2]*[A;B;C] % < which is A*sqrt(f)+B*f+C*f.^2
as closely as it can in a least squares sense.
Roger Stafford
