function MinDist = MinDistToWall(x, y, xyZoneGranules)
    % Output -
    %    distance between a viscous granule and the nearest wall
    % 
    % Input -
    %    x - x-coordinate of the granule center
    %    y - y-coordinate of the granule center
    %    xyZoneGranules - cell comprising the 1x4 array within with the
    %    granules should reside 
    
    xyZoneGranules = xyZoneGranules{1};
    Dists = zeros(1,4);
    Dists(1) = x-xyZoneGranules(1);
    Dists(2) = xyZoneGranules(1)+xyZoneGranules(3)-x;
    Dists(3) = xyZoneGranules(2)+xyZoneGranules(4)-y;
    Dists(4) = y-xyZoneGranules(2);
    MinDist = min(Dists);
end