Skip to main content

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<=30 & m>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

ct1=input('Class Test 1 in 10% Marks=');

if ct1<=10 & ct1>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

ct2=input('Class Test 2 in 10% Marks=');

if ct2<=10 & 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<=5 & a1>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

DM=input('Attendance Before Mid[in 10 Days]=');

if DM<=10 & DM>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

if DM>=8

amm=5

elseif DM>=7 & DM<8

amm=4

elseif DM>=6 & DM<7

amm=3

elseif DM>=5 & DM<6

amm=2

else amm=0

end

MT=m+ctm+a1+amm;

disp('++++++++++++++++++++++++++++++++++++')

disp('50% Marks After Mid Term Examination')

f=input('Final Exam in 30% Marks=');

if f<=30 & f>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

ct3=input('Class Test 3 in 10% Marks=');

if ct3<=10 & ct3>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

ct4=input('Class Test 4 in 10% Marks=');

if ct4<=10 & ct4>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

if ct3>ct4

ctf=ct3

else ctf=ct4

end

a2=input('Assignment 2 in 5% Marks=');

if a2<=5 & a2>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

DF=input('Attendance After Mid[in 10 Days]=');

if DF<=10 & DF>=0

disp('Right Input')

else disp('Wrong Input!!!')

end

if DF>=8

amf=5

elseif DF>=7 & DF<8

amf=4

elseif DF>=6 & DF<7

amf=3

elseif DF>=5 & DF<6

amf=2

else amf=0

end

FT=f+ctf+a2+amf;

disp('Total 100% Marks')

disp('****************')

T=MT+FT

if T>100

disp('Wrong Calculation')

end

disp('Grading & Point System')

disp('**********************')

if T>100

disp('Wrong Calculation')

elseif T>=80

disp ('Outstanding 4.00(A+)')

elseif T>=75 & T<80

disp('Excellent 3.75(A)')

elseif T>=70 & T<75

disp('Very Good 3.50(A-)')

elseif T>=65 & T<70

disp('Good 3.25(B+)')

elseif T>=60 & T<65

disp('Above Average 3.00(B)')

elseif T>=55 & T<60

disp('Average 2.75(B-)')

elseif T>=50 & T<55

disp('Bellow Average 2.50(C+)')

elseif T>=45 & T<50

disp('Poor 2.25(C)')

elseif T>=40 & T<45

disp('Pass 2.00(D)')

elseif T>0 & T<39

disp('Fail 0.00(F)')

else disp('Incomplete 0.00(I)')

end


(try it)

Comments

Popular Posts

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

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

Plotting Voltage

M-File Programming For Subplotting: clc clear subplot(2,2,1) x=0:pi/1800:2*pi; y=sin(x); plot(x,y); title( 'Plot of sin(x)' ); grid subplot(2,2,2) x=0:pi/1800:2*pi; y=sin(x-2*pi/3) plot(x,y); title( 'Plot of sin(x-120)' ); grid subplot(2,2,3) x=0:pi/1800:2*pi; y=sin(x+2*pi/3) plot(x,y); title( 'Plot of sin(x-240)' ); grid (try it) M-File Programming For Three-Phase Voltage: clc clear t=0:pi/1800:2*pi; v1=100*cos(t); plot(t,v1); grid hold on v2=100*cos(t-2*pi/3); plot(t,v2); v3=100*cos(t+2*pi/3); plot (t,v3); title( 'Plotting Three-Phase Voltage of v1(t), v2(t) and v3(t)' ) xlabel ( 'Time in seconds' ) ylabel ( 'Voltage in volts' ) text (6,6, 'v1(t)' ) text (3,4, 'v2(t)' ) text (1,1, 'v3(t)' ) (try it) Discussion: · Plotting figure is also called graphing figure in MATLAB. · In this programming, we can easily

Per-Unit Quantities

M-File Programming For Finding Per-Unit Impedance: -clc -clear -disp('CHANGING THE BASE OF PER-UNIT QUANTITIES') -x=input('given base MVA='); -y=input('given base KV='); -z=input('given per unit impedence='); -a=input('new base MVA='); -b=input('new base KV='); -disp('new per unit impedence='); -pu=z*(y/b)^2*(a/x) (Try it) M-File Programming For Finding Per-Unit Impedance: -clc -clear -disp('PERCENTAGE TRANSMISSION EFFICIENCY OF TX-LINE') -x=input('Receiving end voltage='); -y=input('Load current per-phase='); -z=input('Receiving end power factor='); -a=input('Sending end current='); -b=input('Resistance per-phase='); -disp('Percentage voltage transmission efficiency='); -PVTE=(((x*y*z)/((x*y*z)+(a^2*b)))*100 (try it)