利用holdon与holdof很容易就可以画行波驻波,便于直观地理解电磁波的传播规律驻波:t=0:0.01:10000;z=0:40;fori=1:length(t)y=sin(3/4*pi*t(i)+z)+sin(3/4*pi*t(i)-z);plot(y)ylim([-22])holdonpause(0.01);holdoffend行波:t=0:0.01:10000;z=0:40;fori=1:length(t)y=sin(3/4*pi*t(i)+z);plot(y)ylim([-22])holdonpause(0.01);holdoffend051015202530354045-2-1.5-1-0.500.511.52