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: initq.m
    path of file: ./repos/prima/benchmark/rescue_idz/matlab/interfaces/+newuoa_mat/private
    
    the code of the file until where you have to start completion: function [gq, hq, pq, info] = initq(ij, fval, xpt, debugflag)
    n = size(xpt, 1);
    npt = size(xpt, 2);
    % INITQ initializes the quadratic model, which is represented by
    % (GQ, HQ, PQ) in the following way:
    % the gradient of the model at XBASE is GQ;
    % the Hessian of the model is
    % HQ + sum_{K=1}^NPT PQ(K)*XPT(:, K)*XPT(:, K)'.

    gq = NaN(n, 1);
    hq = NaN(n, n);
    pq = NaN(npt, 1);

    % Local variables

    
function [gq, hq, pq, info] = initq(ij, fval, xpt, debugflag)
    n = size(xpt, 1);
    npt = size(xpt, 2);
    % INITQ initializes the quadratic model, which is represented by
    % (GQ, HQ, PQ) in the following way:
    % the gradient of the model at XBASE is GQ;
    % the Hessian of the model is
    % HQ + sum_{K=1}^NPT PQ(K)*XPT(:, K)*XPT(:, K)'.

    gq = NaN(n, 1);
    hq = NaN(n, n);
    pq = NaN(npt, 1);

    % Local variables
    funname = 'INITQ';

    % Get and verify the sizes.

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