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: generateLines.m
    path of file: ./repos/pretrained-spatial-CNN/src/+helper
    
    the code of the file until where you have to start completion: function coordinates = generateLines(pred, conf, imsize, params, fitPolyLine)
% The generateLines function extracts the lane pixel coordinates from the
% predicted probability map.

% Copyright 2021 The MathWorks, Inc.

% Number of lanes to detect.
numLanes = size(conf,1);

% Filter size for gaussian blur.
gaussFilterSize = [9,9];

% Batch size of input.
batchSize = size(pred,4);

% Create cell array to store the lane coordinates.
coordinates = cell(batchSize,numLanes);

% Threshold value below which the detections are ignored.
threshold = params.threshold;


    
function coordinates = generateLines(pred, conf, imsize, params, fitPolyLine)
% The generateLines function extracts the lane pixel coordinates from the
% predicted probability map.

% Copyright 2021 The MathWorks, Inc.

% Number of lanes to detect.
numLanes = size(conf,1);

% Filter size for gaussian blur.
gaussFilterSize = [9,9];

% Batch size of input.
batchSize = size(pred,4);

% Create cell array to store the lane coordinates.
coordinates = cell(batchSize,numLanes);

% Threshold value below which the detections are ignored.
threshold = params.threshold;

% Suppress warnings generated by fitPolynomialRANSAC.
warning('off','vision:ransac:maxTrialsReached');

% For each image 
for batch = 1:batchSize
    for lane = 1:numLanes
        probMap = pred(:,:,lane+1,batch);
        % Smoothen the probability maps.
        probMap = imgaussfilt(probMap,'FilterSize',gaussFilterSize,'Padding','replicate');
        if conf(lane,batch)>0
            % Extract the lane points from probability maps.
            coordXY = lanePoints(probMap, threshold, imsize);
            % Remove all zeros.
            mask = (coordXY(:,1) == 0) & (coordXY(:,2) == 0);
            coordXY(mask,:) = [];
            if ~isempty(coordXY)
                % Sample points after specified gap including the last
                % point.
                last = coordXY(end