Tips?
If you don't want to fit the full polynomial, you can't use POLYFIT.
Instead, create the data matrix yourself with the terms you want and use
backslash.
x = (1:10).';
a = 5;
c = 2;
y = a+c*x.^2;
M = [x.^2, ones(size(x))]; % M*[c; a] = y
coeffs = M\y
differenceInA = a - coeffs(2)
differenceInC = c - coeffs(1)
The two difference* variables should be small.
--
Steve Lord
sl...@mathworks.com
You can also use my polyfitn, which allows yo to
explicitly specify the model.
http://www.mathworks.com/matlabcentral/fileexchange/10065
John