MATLAB: Plot ellipses by clicking points

drawellipseimage sensingimellipseMATLABobject visualization

How to plot ellipses by clicking on the points. I have a 100*100 cm grid and I would like to generate ellipses in it by clicking different positions. Is there a way to do it? The ellipses can intersect and thereby I need to detect the high region of intersection.

Best Answer

figure
hold on
axis equal
t=-pi:0.01:pi;
for i = 1:10
a=10; % horizontal radius
b=5; % vertical radius
[x0,y0] = getpts() ;
x=x0(1)+a*cos(t);
y=y0(1)+b*sin(t);
plot(x,y)
drawnow
end