`errorbar`

command can indicate the amount of error for each
point using vertical error bars. Try this, % Plotting with error bars close all; clear all; x = linspace(0,pi,30); % 30 equally spaced points between 0 and pi y = 1-x.^2/2+x.^4/(4*3*2); % Approximate the cosine function error = cos(x)-y; % compute the error errorbar(x,y,error)Note that at , the function should be if the approximation were exact. Note the error is larger for increasing values and how this is indicated by the size of the error bars.

Gus Hart 2005-01-28