• Remix
  • Share
  • New Entry

on 30 Oct 2021
  • 6
  • 24
  • 0
  • 0
  • 239
%Example 1:
figure('Color',[.9 .4 .4])
hold
Current plot held
% Self-intersecting polygon
xv = rand(10,1); yv = rand(10,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),'.b',x(~in),y(~in),'.y','LineW',13,'MarkerSi',4)
%plot(xv,yv,x(in),y(in),'^y',x(~in),y(~in),'.r',...
% x(on),y(on),'-b','LineW',13,'MarkerSi',4)
axis off
Image
Remix Tree