How to put errorbars

조회 수: 2 (최근 30일)
Aftab Ahmed Khan
Aftab Ahmed Khan 2014년 7월 25일
답변: Abo Saqer 2017년 8월 15일
Hi Everyone, How can i put errorbars in my figure below (Between red and green graphs)?

채택된 답변

Star Strider
Star Strider 2014년 7월 25일
Use the errorbar function on the line of your choice. The easiest way to do this is to plot that line, then use hold to plot the others:
figure(1)
errorbar(Traffic, EngsetPb, barvector)
hold on
plot( ... the rest ... )
hold off
grid
Hypothetical variables here.
  댓글 수: 5
Aftab Ahmed Khan
Aftab Ahmed Khan 2014년 7월 25일
Awesome, Great. Done Cheers. This is what i get. Still some work left in it as the red graph should match the green graph for me.
Star Strider
Star Strider 2014년 7월 25일
My pleasure!

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

추가 답변 (2개)

Wayne King
Wayne King 2014년 7월 25일
편집: Wayne King 2014년 7월 25일
Do you have the Statistics Toolbox?
x = 1:10;
y = sin(x);
e = std(y)*ones(size(x));
plot(x,y,'b')
hold on
errorbar(x,y,e,'bo','markerfacecolor',[0 0 1])
Not sure exactly what you mean by "between red and green graphs"
I'm assuming that each data point is an estimate and you have an associated confidence inteval that you want to represent
  댓글 수: 2
Aftab Ahmed Khan
Aftab Ahmed Khan 2014년 7월 25일
Thank you for the reply. The red graph is my calculated blocking probability and i want to show the errorbar on this graph. What is mean by confidence interval? Sorry, if it is a very basic question as i am not as good when it comes to statistic.
Wayne King
Wayne King 2014년 7월 25일
Presumably this probability comes with some associated error, you just want to use that error in errorbar()

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


Abo Saqer
Abo Saqer 2017년 8월 15일
Hello
Can I get this code to calculate BP, please

카테고리

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