function D = makeD(alpha1,beta1,VECTOR)
%MATLAB Code Generation Private Function

%   Construct the D matrix or vector using alpha1 and beta1.

%   Copyright 2005-2020 The MathWorks, Inc.
%#codegen

coder.internal.prefer_const(VECTOR);
if VECTOR
    D = alpha1./beta1;
else
    n = numel(alpha1);
    D = zeros(n,'like',alpha1);
    for k = 1:n
        D(k,k) = alpha1(k)/beta1(k);
    end
end
