plotting data with and without errorbars

8 Ansichten (letzte 30 Tage)
Aurélie Merckx
Aurélie Merckx am 20 Mai 2011
Hi!
I'm trying to plot my data with matlab. The problem is that I'd like to plot, on the same graph, my data with errorbars, and a curve without it. Could anyone help me with this?
It's probably very simple but I couldn't find a solution in the matab help nor on google.
Thanks in advance!
Aurélie

Akzeptierte Antwort

Arnaud Miege
Arnaud Miege am 20 Mai 2011
X = 0:pi/10:pi;
Y = sin(X);
E = std(Y)*ones(size(X));
errorbar(X,Y,E)
HTH,
Arnaud
  3 Kommentare
Arnaud Miege
Arnaud Miege am 20 Mai 2011
Use hold on:
X = 0:pi/10:pi;
Y = sin(X);
E = std(Y)*ones(size(X));
errorbar(X,Y,E)
hold on
Z = cos(X);
plot(X,Z)
Aurélie Merckx
Aurélie Merckx am 20 Mai 2011
That did the trick.
Thank you very much!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Errorbars finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by