%% Set Occupancy Values
% Set the occupancy of grid locations using setOccupancy.
% Initialize an occupancy grid object using BinaryOccupancyGrid.

map = robotics.BinaryOccupancyGrid(10,10);

%
% Set the occupancy of a specific location using setOccupancy.

setOccupancy(map,[8 8],1);

%
% Set the occupancy of an array of locations.

[x,y] = meshgrid(2:5);
setOccupancy(map,[x(:) y(:)],1);

% Copyright 2012 The MathWorks, Inc.