function InitCoords = InitialiseParticles(ScriptVar, TotalParticles, xyStartFigure)
    % Initialize particles within the simulation bounds
    % Output - 
    %    InitCoords - k x 2 array where k denotes the number of particles,
    %                 two cols for x and y coords
    %
    % Inputs - 
    %    ScriptVar - Parameters container map
    %    TotalParticles - Total number of particles (1x1 array)
    %    xyStartFigure - Cell of figure boundaries; normally, it comprises
    %                    one 1x4 array where the first two elements are the 
    %                    coordinates of the bottom-left corner of the rectangular 
    %                    bound, third and fourth elements are the length and 
    %                    width of the rectangle
    
    xLimit = ScriptVar('xLimit');
    yLimit = ScriptVar('yLimit');
    InitCoords = zeros(size(TotalParticles,2));
    for i = 1:TotalParticles
        if size(xyStartFigure{1}, 2) == 4
            x = xyStartFigure{1}(1) + xyStartFigure{1}(3)*rand();
            y = xyStartFigure{1}(2) + xyStartFigure{1}(4)*rand();
        else
            x = xLimit*rand();
            y = yLimit*rand();
        end

        while ~IsParticleInsideFigure(x,y, xyStartFigure)...
                || ~IsParticleInsideFigure(x,y, {[0 0 xLimit yLimit]}) 
            x = xLimit*rand();
            y = yLimit*rand();
        end
        
        InitCoords(i,1) = x;
        InitCoords(i,2) = y;
    end
end
