M-File Programming for Transmission Line: clc clear disp( 'STUDYING THE CHARECTERISTICS OF A TRANSMISSION LINE' ) disp( '***************************************************' ) disp( ' ' ) V=input( 'Receiving end line voltage in volt =' ); L=input( 'length of transmission line in km =' ); Pr=input( 'Rated power at receiving end load =' ); pf=input( 'power factor=' ); I=Pr/(sqrt(3)*V*pf); a1=acos(pf); Vr=V/sqrt(3) Ir=I*cos(a1)-j*I*sin(a1) r=input( 'resistance/km/phase=' ); x=input( 'inductive reactance/km/phase=' ); R=r*L; X=j*x*L; Z=R+X if V>20000 y=input( 'capacitive susceptance/km/phase=' ); Y=j*y*L m=Y*Z; end if V<20000 disp( 'SHORT TRANSMISSON LINE' ) disp( '**********************' ) A=1 B=Z C=0 D=A end if V>20000 & V<1
clc clear a=input ( 'A=' ); b=input ( 'B=' ); c=input ( 'C=' ); if a>b if a>b disp ( 'A is greater' ) elseif a||c disp ( 'A=C and greater than B' ) else disp ( 'C is greater' ) end elseif b>c if a||b disp ( 'A=B and greater than C' ) else disp ( 'B is greater' ) end elseif b||c disp ( 'B=C and greater than A' ) else disp ( 'C is greater' ) end (try it)