theta1=input(x方向相位=');theta2=input('y方向相位=');Exm=input('x轴幅值=');Eym=input('y轴幅值=');w=input('角频率=');k=input('输入波数=');xlabel('Ex','fontweight','bold');zlabel('Ey','fontweight','bold');ylabel('Z','fontweight','bold');axis([-22030-22]);gridonview([-5,-4,3]);title('Ô²¼«»¯¶¯Ì¬±ä»¯ÇúÏß')fori=1:30z=[1:0.5:i];changdu=length(z);num=ones(1,changdu);num=num*1e-9;t=num*i;Ex=Exm*cos(w*t-k*z+theta1);Ey=Eym*cos(w*t-k*z+theta2);quiver3(num,z,num,Ex,num,Ey,0,'m')holdonpause(0.2);end