function shadecurves(f, g, a, b)
%SHADECURVES  Draws the region between two curves
%   SHADECURVES(f, g, a, b) inputs two functions f
%   and g, plots them between x = a and x = b, and
%   shades the region in between.
%   Example: shadecurves(@sin, @(x) -sin(x), 0, pi)
fv = str2func(vectorize(func2str(f)));
gv = str2func(vectorize(func2str(g)));
xvals = linspace(a, b, 100); slavx = fliplr(xvals); 
fill([xvals slavx], [fv(xvals) gv(slavx)], [.8 0 1])