www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SymmetricErrorBarsExample.m

    %% Symmetric Error Bars
% Draw symmetric error bars that are two standard deviation units in
% length.

% Copyright 2015 The MathWorks, Inc.


x = 0:pi/10:pi;
y = sin(x);
e = std(y)*ones(size(x));

figure
errorbar(x,y,e)