clear all
lambda1=0.6;
lambda2=0.7;
c1=340;
c2=300;
a1=1;
a2=1;
k1=2*pi/lambda1;
k2=2*pi/lambda2;
omega1=c1*k1;
omega2=c2*k2;
x=0:0.05:5;
t=0:0.5e-4:8e-3;
[X,T]=meshgrid(x,t);
s1=a1*sin(omega1*T-k1*X);
s2=a2*sin(omega2*T-k2*X);
for q=1:size(t,2);
plot(x,s1(q,:),'y',x,s2(q,:),'r',x,s1(q,:)+s2(q,:),'m',0,(a1+a2),'g',0,-(a1+a2),'g');
grid
pause(0.5)
end
