Function for best fitting
Show older comments
I've got a set of data :Y(d). And I am trying to approximate this set for an polynomial function in the following form :
So the problem is to find the values of each constant : "a,b,c,e" , for the best fitting!
So does someone know an possible way to do it,maybe some function ?
Obs:The set of data is quite big , so by "multiple iterations" I don't think Matlab can process some rotine.
1 Comment
Azzi Abdelmalek
on 21 Nov 2012
It does'nt look like a polynomial function
Accepted Answer
More Answers (2)
Use LSQCURVEFIT if you have it.
If noise is sufficiently negligble, you could also rewrite the problem as a linear fitting:
d=d(:);
Y=Y(:);
w=ones(length(d),1);
A=[w,d,-Y, -Y.*d.^3];
[~,~,V]=svd(A);
abce=V(:,end);
If nothing else, this could generate a good initial guess for LSQCURVEFIT.
Categories
Find more on Get Started with Curve Fitting Toolbox 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!