Thanks, works nice, except that it adds legend entries for all the error bar lines. You should set
set(get(get(h,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
for all of the error bar plot handles.
Also, you should change the "All rights reserved" in the errorb.m comments to the BSD license.