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: findColorbarAxis.m
    path of file: ./repos/plotly_matlab/plotly/plotlyfig_aux/helpers
    
    the code of the file until where you have to start completion: function colorbarAxis = findColorbarAxis(obj,colorbarHandle)

    if isHG2    
        colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'ColorbarPeerHandle'),colorbarHandle)),obj.State.Axis));

    
function colorbarAxis = findColorbarAxis(obj,colorbarHandle)

    if isHG2    
        colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'ColorbarPeerHandle'),colorbarHandle)),obj.State.Axis));

        % If the above returns empty then we are on a more recent Matlab
        % release where the appdata entry is called LayoutPeers
        if isempty(colorbarAxisIndex)
            colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'LayoutPeers'),colorbarHandle)),obj.State.Axis));
        end