clear all close all figure(1) subplot(1,2,1) title('Plano s') hold on plot(zeros(1,801),[-40:0.1:40],'b') plot([-40:0.1:1],zeros(1,411),'b') sgrid for k=1:10000 set(0,'Current',1) [re,im]= ginput(1); s1 = re + i*im; s2 = re - i*im; plot(re,im,'xr',re,-im,'xr') title('Plano s') if k>1 plot(re_ant1,im_ant1,'xb',re_ant1,-im_ant1,'xb') end re_ant1 = re; im_ant1 =im; n=[1]; d=conv([1 -s1],[1 -s2]); Gs = tf(n,d); Gz =c2d(Gs,.1); p = pole(Gz); re = real(p(1)); im = imag(p(1)); figure(1) subplot(1,2,2) x=-1:0.01:1; y = sqrt(1 -x.^2); plot(x,y,'b',x,-y,'b') hold on plot(zeros(1,241),[-1.2:0.01:1.2],'b') plot([-1.2:0.01:1.2],zeros(1,241),'b') axis([-1.2 1.2 -1.2 1.2]) plot(re,im,'xr',re,-im,'xr') if k>1 plot(re_ant2,im_ant2,'xb',re_ant2,-im_ant2,'xb') end re_ant2 = re; im_ant2 =im; zgrid end