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: arClearInterpolatedData.m
    path of file: ./repos/d2d/arFramework3/Advanced
    
    the code of the file until where you have to start completion: % arClearInterpolatedData( m, ds )  
%
% Remove datapoints which were added with arInterpolate
    
function arClearInterpolatedData( m, ds )  

    global ar;

    if nargin < 1
        m = 1;
    end
    if nargin < 2
        ds = 'all';
    end
    
    all = 0;
    if ~isnumeric( ds )
        if strcmp( ds, 'all' )
            ds = 1 : numel( ar.model(m).data );
            all = 1;
        end
    end
    
    for jd = 1 : numel( ds )
        if ( ~isfield( ar.model(m).data(ds(jd)), 'addedData' ) )
            if ~all
                warning( 'Data %d does not have interpolated data', ds(jd) );
            end
        else
            interps = sum(ar.model(m).data(ds(jd)).addedData == 1, 2) > 0;
            
            if sum( interps ) > 0
                ar.model(m).data(ds(jd)).yExp(interps, :)    = [];
                ar.model(m).data(ds(jd)).yExpStd(interps, :) = [];
                ar.model(m).data(ds(jd)).tExp(interps)       = [];
                ar.model(m).data(ds(jd)).addedData(interps)  = [];
                fprintf( 'Deleted %d points from data ID %d\n', sum(interps), ds(jd) );
            else
                if ~all
                    warning( 'Data %d does not have interpolated data', ds(jd) );
                end