function h=plot_near(near,Z); mu0=4e-7*pi; eps0=8.854e-12; if (near.coords~='spherical'), disp('Voce nao usou coordenadas esfericas'); break end; if (near.type~='electric'), disp('Voce nao usou type = electric'); break end; if (length(near.freq)~=1), disp('Esta rotina soŽ suporta 1 frequencia por vez'); break end; if ((length(near.x)~=1)|(length(near.z)~=1)), disp('Esta rotina soŽ pode ser usada se R e theta forem constantes'); break end; phi=near.y*pi/180; Ex=near.data(1,:,1,1).*exp(j*near.data(1,:,1,2)*pi/180); Ey=near.data(1,:,1,3).*exp(j*near.data(1,:,1,4)*pi/180); Ez=near.data(1,:,1,5).*exp(j*near.data(1,:,1,6)*pi/180); Ex=Ex(:); Ey=Ey(:); Ez=Ez(:); r=near.x; theta=near.z*pi/180; d=r*sin(theta); Eh=Ey.*cos(phi)-Ex.*sin(phi); Ev=Ez; Emax=max(max((abs([Eh;Ev])))); E0=sqrt(abs(1/Z)^2*real(Z)/(4*pi*r^2)*sqrt(mu0/eps0)); Emax=20*log10(abs(Emax)/E0); figure Edb=20*log10(abs(Eh)/E0); ind=find(Edb<-40); Edb(ind)=-40; h=polar2(phi,Edb,'b',Emax); title(['near field at ',num2str(d),' m']); hd=text(16,53,'dB') hold on Edb=20*log10(abs(Ev)/E0); ind=find(Edb<-40); Edb(ind)=-40; h=polar2(phi,Edb,'g',Emax); title(['near field at ',num2str(d),' m']); hd=text(16,53,'dBi') legend('horizontal','vertical'); hold off