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: CreateImageFilterMtx.m
    path of file: ./repos/StackExchangeCodes/SignalProcessing/Q50329
    
    the code of the file until where you have to start completion: function [ mK ] = CreateImageFilterMtx( vK, numElements, operationMode, boundaryMode )
%UNTITLED6 Summary of this function goes here
%   Detailed explanation goes here

OPERATION_MODE_CONVOLUTION = 1;
OPERATION_MODE_CORRELATION = 2;

B
    
function [ mK ] = CreateConvMtxZeros( vK, numElements )
%UNTITLED6 Summary of this function goes here
%   Detailed explanation goes here

kernelLength    = length(vK);
kernelRadius    = floor(kernelLength / 2); %<! Assuming Odd Kernel
refIdx          = kernelRadius + 1; %<! Assuming Odd Kernel

mK = zeros([numElements, numElements]);

for ii = 1:numElements
    colFirstIdx  = max(ii - kernelRadius, 1);
    colLastIdx   = min(ii + kernelRadius, numElements);
    
    kernelFirstIdx    = colFirstIdx - ii + refIdx;
    kernelLastIdx     = colLastIdx - ii + refIdx;
    
    mK(ii, colFirstIdx:colLastIdx)   = vK(kernelFirstIdx:kernelLastIdx);
end