What is the order of the parameters in the fit?
Show older comments
In the "Exclude Points from Fit" example, I do not understand how the order of the parameters is determined?
[x, y] = titanium;
gaussEqn = 'a*exp(-((x-b)/c)^2)+d'
startPoints = [1.5 900 10 0.6]
f1 = fit(x',y',gaussEqn,'Start', startPoints, 'Exclude', [1 10 25])
How it is possible, that the function fit knows that a is the first and b is the second???
1 Comment
Walter Roberson
on 17 Sep 2015
This is something I have not seen documented. I recommend you switch to anonymous functions as then you can control the parameter order.
Answers (2)
dpb
on 17 Sep 2015
0 votes
The fittype object is built with the assumption of using the coefficients a, b,c,... in models as assumed in alphabetic order unless you use the named arguments to override or add. Doesn't actually ever say that excepting by example you can infer the behavior.
Sachith Dissanayake
on 13 Oct 2017
0 votes
if you have say A1,a1,X1,x1,Y1,y1 variables in a fit function the order is [A1,X1,Y1,a1,x1,y1] Alphabatical order, but upper case variables first comes and then lower case.
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!