image thumbnail
from Monte Carlo simulations using MATLAB by Vincent Leclercq
Demonstrations of Monte Carlo simulations in MATLAB

FillBetween(Xdata,YLower,YUpper,AreaColor,Alpha)
function FillBetween(Xdata,YLower,YUpper,AreaColor,Alpha)

if size(Xdata) == size(YLower)
    fill([vertcat(Xdata,Xdata(end:-1:1))],[vertcat(YLower,YUpper(end:-1:1))],AreaColor,'FaceAlpha',Alpha);
else
    warning('MATLAB:InvlaidArgumentSize','The size of the input is not consistent');
end

Contact us at files@mathworks.com