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: shiftbase.m
    path of file: ./repos/prima/benchmark/rescue_idz/norma/matlab/interfaces/+newuoa_norma_mat/private
    
    the code of the file until where you have to start completion: function [bmat, gq, hq, xbase, xopt, xpt] = shiftbase(idz, pq, zmat, bmat, gq, hq, xbase, xopt, xpt, debugflag)
    n = size(xpt, 1);
    npt = size(xpt, 2);
    % SHIFTBASE shifts the base point for XBASE to XBASE + XOPT and updates
    % GQ, HQ, and BMAT accordingly. PQ and ZMAT remain the same after the
    % shifting. See Section 7 of the NEWUOA paper.

    
function [bmat, gq, hq, xbase, xopt, xpt] = shiftbase(idz, pq, zmat, bmat, gq, hq, xbase, xopt, xpt, debugflag)
    n = size(xpt, 1);
    npt = size(xpt, 2);
    % SHIFTBASE shifts the base point for XBASE to XBASE + XOPT and updates
    % GQ, HQ, and BMAT accordingly. PQ and ZMAT remain the same after the
    % shifting. See Section 7 of the NEWUOA paper.

    % Local variables
    funname = 'SHIFTBASE';

    % Get and verify the sizes

    if debugflag
        if n == 0 || npt < n + 2
            error('Error: %s: SIZE(XPT) is invalid.', funname);
        end