Curve Fitting with erfc
古いコメントを表示
Greetings,
I am trying to fit the attached data (Ydata vs time) with this function attached as a picture.

The coefficients for fitting are B and D and must be positive. L is 1000, Q is -0.0038
I am trying to use cftool with the custom equation
((D*-0.0038/1000^2)*B) .*exp((B.^2) .*(((D.*x))./1000.^2)) .*erfc(B.*(sqrt(((D.*x))./1000^2)))
but it just says my imputs are not real. It would be helpful to see how to fit the data.
2 件のコメント
John D'Errico
2020 年 3 月 26 日
編集済み: John D'Errico
2020 年 3 月 26 日
Why does your custom equation not look like the model you claim to want to use?
Here, for example, we see
exp((B.^2) .*((D.*x)./1000.^2))
what appears to be a term like D*t/L^2.
But then in the next term, if x is supposed to be t, then all you have is sqrt(t).
As far as knowing why your inputs are not real, we cannot conjecture what other wrong things you did, since you already have make a last one significant mistake. That suggests your skills at coding are not incredibly great. While there is nothing overtly wrong with that, it does suggest that you have surely made at least a few other mistakes in your code, especially given the vague error you have described. If you want help, the easiest way to get help is to show what you tried. Then someone can just correct your mistakes.
As well, when you have an error, rather than just trying to describe what you think is pertinent about the error message, show the complete error text, so everything in red.
Russell Evans
2020 年 3 月 26 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


