clear
clc

X=-3:1/100:3;

% Amplitude
AmplitudeWaveI=3;
AmplitudeWaveII=3;

% WaveNumber (Wavelength=1.5708)
WaveNumberWaveI=4;
WaveNumberWaveII=4;

% Angular Frequency (Period=1.5708)
AngularFrequencyWaveI=4;
AngularFrequencyWaveII=4;

WaveI(1,1:length(X))=AmplitudeWaveI.*sin((WaveNumberWaveI.*X)-(AngularFrequencyWaveI.*1));
WaveII(1,1:length(X))=AmplitudeWaveII.*sin((WaveNumberWaveII.*X)+(AngularFrequencyWaveII.*1));
StandingWave(1,1:length(X))=WaveI(1,1:length(X))+WaveII(1,1:length(X));

Counter=2;
for Time=1.05:0.05:3
   
   WaveI(Counter,1:length(X))=AmplitudeWaveI.*sin((WaveNumberWaveI.*X)-(AngularFrequencyWaveI.*Time));
   WaveII(Counter,1:length(X))=AmplitudeWaveII.*sin((WaveNumberWaveII.*X)+(AngularFrequencyWaveII.*Time));
   StandingWave(Counter,1:length(X))=WaveI(Counter,1:length(X))+WaveII(Counter,1:length(X));
   Counter=Counter+1;
   
end

figure(1);
PropagationParameter=[1:1:Counter-1];
PropagationEvolution=StandingWave(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h1=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h1,'MeshStyle','row');
title('The Standing Wave');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off