How to define error bar in Matlab
I would like to define error bars on both ends for matlab. Usually, the example of matlab would be http://matlab.izmiran.ru/help/techdoc/ref/errorb开发者_开发百科ar.html where the error bar would take the standard deviation (E) and make it equal(symmetric) on both ends.
I would like to define two points specifically apart from plotting the exact point (x,y).
Please advise. Thanks.
As Singlet mentions, the L and U parameters for errorbar should do the job:
% Create some example input data.
x = 1:10
y = cumsum( randn(1,10) );
lower = y - ( rand(1,10) );
upper = y + ( rand(1,10) );
% Convert absolute lower and upper bounds into the relative values
% values that are expected by the errorbar function.
L = y - lower;
U = upper - y;
figure(1);
clf;
hold('on');
plot( x, y, 'b-' );
errorbar( x, y, L, U, 'r', 'Marker', 'none', 'LineStyle', 'none' );
精彩评论