for i = obstacle_origin(1): obstacle_origin(1)+ obstacle_size(1) for j = obstacle_origin(2) : obstacle_origin(2) + obstacle_size(2) Map(i,j) = 1; end end
% fill the map with the start point
Map(x_s,y_s)= 2;
% fill the map with the target point
Map(x_t,y_t) =3;
% plot the map along with obstacle, start point and target point figure grid on hold on