Forward and Backward Waveform

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Code for forward and backward waveform

clc
clear all
x=1:0.05:6;
w=50;
B=4;
t=0;
t1=1;
t2=2;
t3=3;
f=cos(w*t-B*x);
f1=cos(w*t1-B*x);
f2=cos(w*t2-B*x);
f3=cos(w*t3-B*x);
hold on
plot(x,f,'k')
plot(x,f1,'r')
plot(x,f2,'c')
plot(x,f3,'m')
h=cos(B*x+w*t);
h1=cos(B*x+w*t1);
h2=cos(B*x+w*t2);
h3=cos(B*x+w*t3);
figure
hold on
plot(x,h,'k')
plot(x,h1,'r')
plot(x,h2,'c')
plot(x,h3,'m')

Forward waveform

Backward waveform.

You might also like