uniform_random_locations_inside_polygon = rand_pts_xy(:,in);% Desired Output figure(1) plot(poly_xy(1,:), poly_xy(2,:),'-b','LineWidth',1.5) holdon scatter(rand_pts_xy(1,in), rand_pts_xy(2,in),'rp','MarkerFaceColor','g') ...