function P=square(a,b,c,d)
clf
axis([a b c d])
hold on
hnappur=1;
while hnappur==1
[x,y,hnappur]=ginput(1);
if hnappur==1
plot(x,y,'o')
end
end
It puts up a picture and I can click on it to plot single points. I want to add to this function that it can read four points that I click, and draw a rectangle between them. How do I make matlab read the point that I click?
Comments
Leave a comment