clear all close all clc
load Mul.txt
d1=3e-3;
d2=3e-3;
d3=2e-3;
d4=2e-3;
f=(10^9)*Mul(:,1);
eb1a=Mul(:,2);
eb1b=Mul(:,3);
ebA=complex(eb1a,-eb1b);
eb2a=Mul(:,4);
eb2b=Mul(:,5);
ebB=complex(eb2a,-eb2b);
eb3a=Mul(:,6);
eb3b=Mul(:,7);
ebC=complex(eb3a,-eb3b);
eb4a=Mul(:,8);
eb4b=Mul(:,9);
ebD=complex(eb4a,-eb4b);
c=3*10^8;
Z0=377;
j=sqrt(-1);
gamma1=2*pi*f*(1/c)*sqrt(1/ebA);
m1=sqrt(1/ebA)*tanh(gamma1*d1)+Z0;
n1=(Z0*tanh(gamma1*d1))+sqrt(1/ebA);
Z1=m1/n1;
gamma2=2*pi*f*(1/c)*sqrt(1/ebB);
m2=sqrt(1/ebB)*tanh(gamma2*d2)+Z1;
n2=(Z0*tanh(gamma2*d2))+sqrt(1/ebB);
Z2=m2/n2;
k3=1i*2*pi*f*(1/c).*sqrt(1.*ebC);
m2=Z2+Z0*sqrt(1./ebC).*tanh(k3*d3);
n2=Z0*sqrt(1./ebC)+Z2.*tanh(k3*d3);
Z3=(m2/n2)*Z0*sqrt(1./ebC);
k4=1i*2*pi*f*(1/c).*sqrt(1.*ebD);
m3=Z3+Z0*sqrt(1./ebD).*tanh(k4*d4);
n3=Z0*sqrt(1./ebD)+Z3.*tanh(k4*d4);
Z4=(m3/n3)*Z0*sqrt(1./ebD);
RL=20*log10(abs((Z2-Z0)/(Z2+Z0)));
figure(1)
subplot(211)
plot(f,real(Z2),'Linewidth',2),grid
ylabel('Real part z2')
subplot(212)
plot(f,imag(Z2),'Linewidth',2),grid,shg
xlabel('Frequency HZ')
ylabel('Imaginary part z2')
figure(2)
plot(f,RL,'Linewidth',2),grid
ylabel('RL')
xlabel('Frequency HZ')
Best Answer