필터 지우기
필터 지우기

error bar in curve fitted graph

조회 수: 3 (최근 30일)
Debarati Ghosh
Debarati Ghosh 2024년 3월 29일
댓글: Sam Chak 2024년 4월 1일
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?

답변 (1개)

Sam Chak
Sam Chak 2024년 3월 29일
x = (-1:0.1:1)';
y = asinh(x/0.5);
f = fit(x, y, 'poly1')
f =
Linear model Poly1: f(x) = p1*x + p2 Coefficients (with 95% confidence bounds): p1 = 1.576 (1.514, 1.638) p2 = -6.057e-18 (-0.03753, 0.03753)
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
Debarati Ghosh
Debarati Ghosh 2024년 4월 1일
@Sam Chakthank you sir
Sam Chak
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 CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by