function ellipsen % zeichnet mehrere Ellipsen % Grafikfenster öffnen clf; hold on; axis([-10 10 -10 10]); weiter=true; while weiter % Eingabe von Mittelpunkt und Halbachsenlängen [x,y,button] = ginput(1); if button ~= 1 weiter=false; else plot(x, y,'ro'); H = inputdlg({'a:', 'b:'}); a = str2num(H{1}); b = str2num(H{2}); % Zeichnen der Ellipse t = linspace(0,2*pi); plot(x+a*cos(t), y+b*sin(t)); end end