problem with error bar

Hi. I want to use errorbar(x,y,std) to get the error bar. I was wondering if x and y are vectors with 10 data point each. how do I write the code for std to have the same matching (10X1) dimension. Thanks

 Accepted Answer

e = std(y)*ones(size(y));

1 Comment

As in:
x = 1:10;
y = randn(10,1);
e = std(y)*ones(10,1);
errorbar(x,y,e)

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!