How do I fit errorbars with standard deviation on a fitted curve using cftool?
9 次查看(过去 30 天)
显示 更早的评论
Hey,
I am using cftool to fit special exponential curves with custom equation. I'd like to have errorbars (with standard deviation) in this graphic (fitted curve) for the individual measured points. Is is possible to do that using cftool? If not, could you please tell me how to do the fitting and the errorbars without cftool. I really need step by step explanations, because I am an absolutely newcomer in Matlab.
Thanks in advance.
Julia
0 个评论
采纳的回答
Mads
2014-7-7
Hey J
Here is one suggestion:
1) use cftool as you do to make a fit on your data. Once you are are done, in the cftool window you go to "File", and click "Generate Code"
That should give you a m-file that basically, when run, gives you the same result as when you manually used cftool.
2) Now you use the output from the fit-function which you see in this m-file.
The second output from fit, say it is called gof, is a goodness-of-fit-struct which contains fx. rmse (standard error)
so I think you look for:
gof.rmse
3) Play with the plotting-function errorbar(...)
Takes:
figure errorbar(X,Y,E)
where E is the errorbar value on Y for a given X
so E associates with gof.rmse if I understand correctly if X and Y are the fit data, not the real data.
Hope this helps.
I found it useful to read about "fit" in the documentation.
Best
Mads
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!