plotting data with and without errorbars

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

 採用された回答

Arnaud Miege
Arnaud Miege 2011 年 5 月 20 日

0 投票

X = 0:pi/10:pi;
Y = sin(X);
E = std(Y)*ones(size(X));
errorbar(X,Y,E)
HTH,
Arnaud

3 件のコメント

Aurélie Merckx
Aurélie Merckx 2011 年 5 月 20 日
Apparently I haven't been clear enough. The data I want to plot with errorbars and the curve are not the same thing.
So on the one hand, there is data with errors, that I can plot using errorbars(X,Y,E)
On the other hand, there is more data, I want to plot without errorbars, which I can do using something that looks likde this: plot (X1, Y1).
But somehow, I can't have those two on the same graph.
Arnaud Miege
Arnaud Miege 2011 年 5 月 20 日
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 2011 年 5 月 20 日
That did the trick.
Thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeErrorbars についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by