%======矩形孔洞 SquareHole=======lengthx=1200e-9;lengthy=1200e-9;lengthz=20e-9;nindex=1^2;sigma=0;choice='PEC'; %E_Iso,PEC,M_Iso,PMC,E_Model1,M_Model1,EM_Model1gridtype=-1; %xposition=icenter*gdx;yposition=icenter*gdy;zposition=kcenter*gdz;Iso_SquareHole(choice,gridtype,nindex,sigma,xposition,yposition,zposition,lengthx,lengthy,lengthz)%==========矩形孔洞 SquareHole==========figure(2);hold on;a = 4; b = 4;[theta,phi] = meshgrid(-90:1:90, 0:1:360);theta = theta*pi/180; phi = phi*pi/180;vx = a*sin(theta).*cos(phi);vy = b*sin(theta).*sin(phi);E = abs((1 + cos(theta))/2 .* sinc(vx) .* sinc(vy));surf(vx/a,vy/b,(E));shading interp; colormap(jet)set(gca, 'color', 'none');set(gcf, 'InvertHardCopy', 'off');a_theta=(theta_start:theta_span:theta_end)*pi/180;a_phi=(phi_start:phi_span:phi_end)*pi/180;[b_theta,b_phi]=meshgrid(a_theta,a_phi);figure(2)vx=sin(b_theta).*cos(b_phi);vy=sin(b_theta).*sin(b_phi);plot3(vx,vy,RCS_Far'/max(RCS_Far(:)));shading interp;xlabel('X');ylabel('Y');view(-30,10)=====