Skip to main content

Posts

Studying The Charecteristics of a Transmission Line by MATLAB Programming

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 disp( 'SHORT TRANSMISSON LINE' ) disp( '**********************' ) A=1 B=Z C=0 D=A end if V>20000 & V disp( ...
Recent posts

MATLAB programming among three Variables

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)

Marks Calculation in Examination MATLAB Programming

clc clear disp( 'Marks Calculation in Examination' ) disp( '********************************' ) disp( '50% Marks Before Mid Term Examination' ) disp( '-----------------------------------' ) m=input( 'Mid Term in 30% Marks=' ); if m =0 disp( 'Right Input' ) else disp( 'Wrong Input!!!' ) end ct1=input( 'Class Test 1 in 10% Marks=' ); if ct1 =0 disp( 'Right Input' ) else disp( 'Wrong Input!!!' ) end ct2=input( 'Class Test 2 in 10% Marks=' ); if ct2 =0 disp( 'Right Input' ) else disp( 'Wrong Input!!!' ) end if ct1>ct2 ctm=ct1 else ctm=ct2 end a1=input( 'Assignment 1 in 5% Marks=' ); if a1 =0 disp( 'Right Input' ) else disp( 'Wrong Input!!!' ) end DM=input( 'Attendance Before Mid[in 10 Days]=' ); if DM =0 disp( 'Right Input' ) else disp( 'W...

Matrix calculation with MATLAB Programming

First, let's create a simple vector with 9 elements called a . a = [1 2 3 4 6 4 3 4 5] a = 1 2 3 4 6 4 3 4 5 Now let's add 2 to each element of our vector, a , and store the result in a new vector. Notice how MATLAB requires no special handling of vector or matrix math. b = a + 2 b = 3 4 5 6 8 6 5 6 7 Creating graphs in MATLAB is as easy as one command. Let's plot the result of our vector addition with grid lines. plot(b) grid on MATLAB can make other graph types as well, with axis labels. bar(b) xlabel( 'Sample #' ) ylabel( 'Pounds' ) MATLAB can use symbols in plots as well. Here is an example using stars to mark the points. MATLAB offers a variety of other symbols and line types. plot(b, '*' ) axis([0 10 0 10]) One area in which MATLAB excels is matrix computation. Creating a matrix is as easy as making a vector, using semicolons (;) to separate the rows of a matrix. A = [1 2...