What is the order of the parameters in the fit?

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

This is something I have not seen documented. I recommend you switch to anonymous functions as then you can control the parameter order.

Sign in to comment.

Answers (2)

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.
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

Asked:

on 17 Sep 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!