Filter löschen
Filter löschen

(somewhat) specifying coefficients for curve fitting

1 Ansicht (letzte 30 Tage)
J.S.
J.S. am 28 Jun. 2018
Beantwortet: Walter Roberson am 28 Jun. 2018
I have a set of data that I am fitting with the modified ("custom", because it has offsets) two-exponential fit a*exp(b*(x-x0))+c*exp(d*(x-x0))+y0. Offsets x0 and y0 are known. From my data, I know what the upper and lower bounds for a-d should be, and I have imposed these constraints in my code. Since I do not precisely know what starting values for a-d I should set, I am leaving that to MATLAB's random start point selection. However, one disadvantage is that, between any two fit attempts, not only will the values for a-d be different, but also a might be bigger than c in one fit, and then at the next attempt, a is smaller than c. This result then influences whether b is bigger than d or b is smaller than d. Since I need to perform fitting multiple times to find distributions (via histograms) of b and d, this could be a problem. Is there some way I can tell MATLAB that a should be bigger than c, regardless of MATLAB's chosen start points?
Thanks very much in advance!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Jun. 2018
No, there is not. However, you can use
FitFcn = @(a,b,c,d,x) RealFitFcn(max(a,c), b, min(a,c), d, x)

Weitere Antworten (0)

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by