(somewhat) specifying coefficients for curve fitting

1 次查看(过去 30 天)
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!

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by