%

% Copyright 2017-2021 The MathWorks, Inc.
function column = enforceRectangularData(this, tableName, column, fillValue)
    numRows = size(this.(tableName), 1);
    if numRows == 0
        return;
    end

    columnSize = size(column, 1);
    if numRows > columnSize
        if islogical(column)
            column = double(column); % NaN cannot be converted to logical
        end
        column(columnSize + 1 : numRows, :) = fillValue; % add to column
    elseif numRows < columnSize
        this.(tableName) = xls.internal.UpdateExistingTables.convertLogicalToDouble(this.(tableName));
        this.(tableName){numRows + 1 : columnSize, :} = fillValue; % add to table
    end
end
