Plotting error bars / Standdarddeviations

조회 수: 1 (최근 30일)
Ann Gerber
Ann Gerber 2018년 6월 23일
댓글: Star Strider 2018년 6월 24일
My task seems very simple to me but I just couldn't find the answer online. So: x=[3, 6, 9, 12]; //x-values y=[13.6 16.0 19.7 17.0]; //corresponding y-values of the data series err = [1.42 1.88 4.36 4.39]; //Standarddeviations to all the y values. I want to have a plot of the x-values vs y values and the standarddeviations as errorbars in every point. If I plot it like this, the error bars don't have the appropriate length. How can I do that? Thanks a lot!

채택된 답변

Star Strider
Star Strider 2018년 6월 23일
You did not say exactly what you had tried.
See if this does what you want:
figure
errorbar(x, y, err)
grid
xlim([0 15]);
The error bars will be symmetric, and ± the standard deviations at each point.
  댓글 수: 1
Star Strider
Star Strider 2018년 6월 24일
My pleasure.
If my Answer helped you solve your problem, please Accept it!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ann Gerber
Ann Gerber 2018년 6월 24일
Found it out. Thanks for the quick reply!

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by