When using ERRORBAR, I would like to be able to use a scalar for the error bar length instead of a vector (all error bar of the same length).
For example, the following piece of code works:
X = 0:pi/10:pi;Y = sin(X);E = std(Y)*ones(size(X));errorbar(X,Y,E)
But the following:
X = 0:pi/10:pi;Y = sin(X);E = 0.371;errorbar(X,Y,E)
produces this error:
??? Error using ==> errorbar at 76 X, Y and error bars must all be the same length
Best Answer