When using ERRORBAR, I like to be able to use a scalar for the error bar length instead of a vector (all error bar of the same length).
If I type like this,
X = 0:pi/10:pi;
Y = sin(X);
E = 0.371;
errorbar(X,Y,E)
MATLAB shows "X, Y and error bars must all be the same length" How do I overcome this?

回答 (1 件)

dpb
dpb 2015 年 9 月 6 日

0 投票

As similar to the example in the documentation,
E = 0.371*ones(size(x));

1 件のコメント

dpb
dpb 2015 年 9 月 7 日
I will agree it would be a reasonable enhancement request to expand the input syntax to allow the scalar argument albeit pretty low-priority as the workaround is so trivial...

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

カテゴリ

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

タグ

質問済み:

2015 年 9 月 6 日

コメント済み:

dpb
2015 年 9 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by