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: removePoints.m
    path of file: ./repos/scGEAToolbox/+run/thirdparty/MPPC
    
    the code of the file until where you have to start completion: function [ynew, znew, bnew] = removePoints(y, z, b, locations)
%REMOVEPOINTS removes points from y.
%   This function deletes the points in y in the specified indices, and z
%   and b are updated appropriately. The 'locations' is a column vector
%   that specifies which indices in y to remove.

[m, ~] = size(y);
ynew = y;

    
function [ynew, znew, bnew] = removePoints(y, z, b, locations)
%REMOVEPOINTS removes points from y.
%   This function deletes the points in y in the specified indices, and z
%   and b are updated appropriately. The 'locations' is a column vector
%   that specifies which indices in y to remove.

[m, ~] = size(y);
ynew = y;
znew = z;
bnew = b;
if ~isempty(locations)
    adjust_locs = locations(locations > 1 & locations < m);
    znew(adjust_locs, :) = z(adjust_locs, :) + z(adjust_locs-1, :);
    bnew(adjust_locs, :) = b(adjust_locs, :) + b(adjust_locs-1, :);

    rem_locs = adjust_locs - 1;
    if sum(locations == 1) > 0
        rem_locs = [rem_locs; min(setdiff(1:m-1, rem_locs))];
    end