From: mins alaa on
I am stuck in a part of a project I'm doing I need some matlab code to allow the user to click any number of points mean while drawing a triangle after any three clicked points.
i.e. the clicked points should be the corners of the triangle.
Also to allow the user to keep clicking so for each three points clicked a different triangle should be plotted.
i.e. if the user clicks nine points, three triangles should be plotted
From: Luca Balbi on
I'm not sure if that was what you meant, in my opinion with 9 points more than 3 triangles should come out...

Is this what you expect with 9 points?

[x,y] = ginput(9);
TRI = delaunay(x,y);
triplot(TRI,x,y,'red');
From: abdullah on
use this :

while 1
[x,y] = ginput(3);
TRI = delaunay(x,y);
triplot(TRI,x,y,'-');
hold all
end

P.S. i hope u r not a GUC student ;)
 | 
Pages: 1
Prev: Random matrix with boundaries
Next: bar plots