Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %[region]=define_regions([0, 10,0,10], 4);
- %% citire
- N=input('How many regions would you like to draw?\n');
- figure()
- axis([0 20 0 20]),hold on;
- %% desenare a)
- for i=1:N
- [x,y] = ginput(6);
- plot(x,y, '.');
- k = convhull(x,y);
- hold on, plot(x(k), y(k), '-r'), hold off
- axis([0 9 0 9]),hold on;
- fill(x(k),y(k),'o')
- Region{i}.x=x(k); Region{i}.y=y(k);
- centre{i}.x=mean(Region{i}.x);
- centre{i}.y=mean(Region{i}.y);
- end
- %% little robot b)
- hold on;
- [rx,ry]= ginput(1);
- plot(rx,ry,'*k');
- speed=input('Do you like speed? Enter the speed please\n');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement