function A = subsdeleteTabularBraces(A, subs)
% Brace deletion for distributed table/timetable (not currently supported)

% Copyright 2019-2020 The MathWorks, Inc.

% Brace deletion of tables is not supported.
if numel(subs.subs)==2
    numCols = iGetIndexingSize(subs.subs{2}, width(A));
    error(message("MATLAB:table:BracesAssignDelete", numCols));
elseif numel(subs.subs)==1
    error(message('MATLAB:table:LinearSubscript'));
else % numel(subs.subs)~=2
    error(message("MATLAB:table:NDSubscript"));
end
end


function sz = iGetIndexingSize(sub, szA)
% Work out how many elements this subscript wants
if parallel.internal.indexing.isColonLiteral(sub)
    sz = szA;
elseif parallel.internal.indexing.isColonDescriptor(sub)
    sz = length(sub);
elseif islogical(sub)
    sz = nnz(sub);
else
    sz = numel(sub);
end
end