You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: errorbar_horizontal.m
    path of file: ./repos/CanlabCore/CanlabCore/Visualization_functions
    
    the code of the file until where you have to start completion: function hh = errorbar_horizontal(varargin)
% Error bar plot
%
% :Usage:
% ::
%
%    errorbar_horizontal(X,Y,L,U)
%
% plots the graph of vector X vs. vector Y with
% error bars specified by the vectors L and U.  L and U contain the
% lower and upper error ranges for each point in Y.  Each error bar
% is L(i) + U(i) long and is drawn a distance of U(i) above and L(i)
% below the point
    
function str=id(str)
str = ['MATLAB:errorbar:' str];

function [l,c,m] = nextstyle(ax,autoColor,autoStyle,firsttime)
%NEXTSTYLE Get next plot linespec
%   [L,C,M] = NEXTSTYLE(AX) gets the next line style, color
%   and marker for plotting from the ColorOrder and LineStyleOrder
%   of axes AX.
%
%   See also PLOT, HOLD

%   [L,C,M] = NEXTSTYLE(AX,COLOR,STYLE,FIRST) gets the next line
%   style and color and increments the color index if COLOR is true
%   and the line style index if STYLE is true. If FIRST is true
%   then start the cycling from the start of the order unless HOLD
%   ALL is active.

if nargin == 1
  autoColor = true;
  autoStyle = true;
  firsttime = false;
end