error bar in curve fitted graph
9 次查看(过去 30 天)
显示 更早的评论
Sir,
I am having two data x and y . After that I have fitted data using curve fitting tool (using polunomial of degree 1). Then I got plot with curve fitted graph. I want to get error in this graph as error bar. How to get?
0 个评论
回答(1 个)
Sam Chak
2024-3-29
x = (-1:0.1:1)';
y = asinh(x/0.5);
f = fit(x, y, 'poly1')
err = y - f(x);
errorbar(x, y, err), hold on
plot(x, f(x), '--.'), grid on
xlabel x, ylabel y
legend('data', 'fitted poly1', 'location', 'se')
2 个评论
Sam Chak
2024-4-1
Hi @Debarati Ghosh, If you find the solution helpful, please consider clicking 'Accept' ✔ on the answer to close the issue.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Errorbars 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!