- /
-
Pterodactylus
on 1 Nov 2021
- 1
- 22
- 0
- 0
- 256
%Example 1:
figure('Color',[.9 .1 .1602])
hold
% polygon
xv = rand(9,1); yv = rand(9,1);
xv = [xv ; xv(1)]; yv = [yv ; yv(1)];
x = rand(6e4,1); y = rand(6e4,1);
[in,on] = inpolygon(x,y,xv,yv);
plot(xv,yv,x(in),y(in),'y',x(~in),y(~in),'.b','LineW',13,'MarkerSi',6)
plot(x(on),y(on))
axis off