clf %clear plot clear x y %clear vars x y plot(0,0),axis([-2,2,-2,2]),hold on [x(1),y(1)]=ginput(1), plot(x(1),y(1),'*') %input and plot 1. point [x(2),y(2)]=ginput(1), plot(x(2),y(2),'*') % ditto for 2. point plot([x(1),x(2)],[y(1),y(2)]) % connect both with line