It has been driving me crazy that I can't quickly get errorbar to do this on its own. Often in we have uncertainty in both x and y (or in atmospheric science the dependent variable is often on the x axis).
It is a simple function and works almost exactly like errorbar.
Anthony Bathgate (2020). xerrorbar - Just like errorbar, but for uncertainty in x. (https://www.mathworks.com/matlabcentral/fileexchange/34559-xerrorbar-just-like-errorbar-but-for-uncertainty-in-x), MATLAB Central File Exchange. Retrieved .