Filter löschen
Filter löschen

How to put errorbars

4 Ansichten (letzte 30 Tage)
Aftab Ahmed Khan
Aftab Ahmed Khan am 25 Jul. 2014
Beantwortet: Abo Saqer am 15 Aug. 2017
Hi Everyone, How can i put errorbars in my figure below (Between red and green graphs)?

Akzeptierte Antwort

Star Strider
Star Strider am 25 Jul. 2014
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 Kommentare
Aftab Ahmed Khan
Aftab Ahmed Khan am 25 Jul. 2014
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 am 25 Jul. 2014
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Wayne King
Wayne King am 25 Jul. 2014
Bearbeitet: Wayne King am 25 Jul. 2014
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 Kommentare
Aftab Ahmed Khan
Aftab Ahmed Khan am 25 Jul. 2014
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 am 25 Jul. 2014
Presumably this probability comes with some associated error, you just want to use that error in errorbar()

Melden Sie sich an, um zu kommentieren.


Abo Saqer
Abo Saqer am 15 Aug. 2017
Hello
Can I get this code to calculate BP, please

Kategorien

Mehr zu Errorbars finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by