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

    %-AXIS INDEX-%
    axIndex = obj.getAxisIndex(obj.State.Plot(plotIndex).AssociatedAxis);

    %-PLOT DATA STRUCTURE- %
    plotData = get(obj.State.Plot(plotIndex).Handle);

    %-CHECK FOR MULTIPLE AXES-%
    [xsource, ysource] = findSourceAxis(obj, axIndex);

    %-ASSOCIATE POLAR-AXES LAYOUT-%
    obj.data{plotIndex}.subplot = sprintf('polar%d', xsource+1);

    %-------------------------------------------------------------------------%

    %-parse plot data-%
    rData = plotData.RData;
    thetaData = rad2deg(plotData.ThetaData);

    thetaData(rData<0) = mod(thetaData(rData<0)+180, 360);
    rData = abs(rData);

    %-------------------------------------------------------------------------%

    %-scatterpolar trace setting-%
    obj.data{plotIndex}.type = 'scatte
    
function updatePolaraxes(obj, plotIndex)

    %-------------------------------------------------------------------------%

    %-AXIS INDEX-%
    axIndex = obj.getAxisIndex(obj.State.Plot(plotIndex).AssociatedAxis);

    %-CHECK FOR MULTIPLE AXES-%
    [xsource, ysource] = findSourceAxis(obj, axIndex);
        
    %-GET DATA STRUCTURES-%
    plotData = get(obj.State.Plot(plotIndex).Handle);
    axisData = get(plotData.Parent);
    thetaAxis = get(axisData.ThetaAxis);
    rAxis = get(axisData.RAxis);

    %-------------------------------------------------------------------------%

    %-set domain plot-%
    xo = axisData.Position(1);
    yo = axisData.Position(2);
    w = axisData.Position(3);
    h = axisData.Position(4);

    polarAxis.domain.x = min([xo xo + w], 1);
    polarAxis.domain.y = min([yo yo + h], 1);

    %-------------------------------------------------------------------------%
        
    %-setting angular axis-%
    gridColor = sprintf('rgba(%f,%f,%f,%f)', 255*axisData.GridColor, ...
        axisData.GridAlpha);
    gridWidth = axisData.LineWidth;
    thetaLim = thetaAxis.Limits;
    
    polarAxis.angularaxis.linecolor = gridColor;
    polarAxis.angularaxis.ticklen = mean(thetaAxis.TickLength);

    if isnumeric(thetaLim)
        polarAxis.angularaxis.range = thetaLim;
    else
        polarAxis.angularaxis.autorange = true;
    end