Tuesday, 14 May 2013

Smith Chart -Matlab Progaming Code



Hi Engineers, I don't want to tell lie about my this post so i thought that without going all around the world i am coming straight to the point. Yesterday I have my EM theory exam and my exam fear has been increased by this programing of which contains bunch of typical codings which is not almost impossible to rember in just a night study, which is very much comman for all enginnering students.

So after messing up with my brain i came out with a woundrfull idea !!

Why don't i copy paste my coding in here and get it if i get my luck stuck with smith chart.



So I do Just the same....

Smith Chart Mat lab Coding :


t=linspace(0,2*pi,100);
x=cos(t);
y=sin(t);
plot(x,y,'linewidth',2);
title('smith chart');
hold on;
k=[0.25,0.5,0.75];
for i=1:length(k)
    x(i,:)=k(i)+(1-k(i))*cos(t);
    y(i,:)=(1-k(i))*sin(t);
    plot(x(i,:),y(i,:),'k');
end;
kt=[2.5,pi,3.79,4.22];
k=[0.5,1,2,4];
for j=1:length(kt)
    t=linspace(kt(j),1.5*pi,50);
    a(j,:)=1+k(j)*cos(t);
    b(j,:)=k(j)+k(j)*sin(t);
    plot(a(j,:),b(j,:),'k',a(j,:),-b(j,:),'k')
end;
z0=input('z0=')
zl=input('zl=')
z1=zl/z0
g=(z1-1)/(z1+1)
m=abs(g)
th=angle(g)
vswr=(1+m)/(1-m)
r=20*log(m)
thd=th*pi/180
polar(m,thd,'rd')

Blog Top Sites

Share Our Badge

 Computer Stuffs

Be Updated Its Free.

Subscribe via Email

Visitors Everyday



Followers