clear all; close all; clc %function m=Map; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Start @ location (-10,-10). Apply controls to reach (10,10) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% xw=-14; xe=14; ys=-14; yn=14; %map dimensions, west, east, south, north mrx=0.05; mry=0.05; % map resolution {x,y} [xm ym]=meshgrid(xw:mrx:xe,ys:mry:yn); m=0*xm.*ym; % initialize the map m for i=1:size(xm,2) for j=1:size(ym,1) r=sqrt(xm(1,i)^2+ym(j,1)^2); ang=atan2(ym(j,1),xm(1,i))+pi; r1=sqrt((xm(1,i)-xe)^2+(ym(j,1)-yn)^2); ang1=atan2(ym(j,1)-yn,xm(1,i)-xe)+pi; r2=sqrt((xm(1,i)-xw)^2+(ym(j,1)-ys)^2); ang2=atan2(ym(j,1)-ys,xm(1,i)-xw)+pi; if (26