How to put errorbars
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aftab Ahmed Khan
le 25 Juil 2014
Réponse apportée : Abo Saqer
le 15 Août 2017
Hi Everyone, How can i put errorbars in my figure below (Between red and green graphs)?
0 commentaires
Réponse acceptée
Star Strider
le 25 Juil 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 commentaires
Plus de réponses (2)
Wayne King
le 25 Juil 2014
Modifié(e) : Wayne King
le 25 Juil 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 commentaires
Wayne King
le 25 Juil 2014
Presumably this probability comes with some associated error, you just want to use that error in errorbar()
Voir également
Catégories
En savoir plus sur Errorbars dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!