フィルターのクリア

(somewhat) specifying coefficients for curve fitting

1 回表示 (過去 30 日間)
J.S.
J.S. 2018 年 6 月 28 日
回答済み: Walter Roberson 2018 年 6 月 28 日
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 Center および File ExchangeInterpolation についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by