Sunteți pe pagina 1din 3

Casilao, Princess Lheakyrie R.

ECE-2102
Activity No. 1
(Grade Computation Algorithm)
Introduction
MATLAB stands for Matrix Laboratory. MATLAB is one of the most popular fourth-
generation programming languages in the world. It is also the most powerful and high-
performance language that is used in technical computing. It integrates computation,
visualization, and programming in an easy-to-use environment where problems and solutions are
expressed in familiar mathematical operation notation. Its typical uses include math and
computation. It is used for matrix calculations and developing the algorithms, also for creating
UI and data visualization. It also allows you to run programs that have been created in ant other
programming language. It means that you can utilize the strength of other programming
languages in MATLAB.
For this activity, MATLAB was used to import an excel spreadsheet and create a grade
computation algorithm.
Flowchart
For this activity, a grade computation algorithm was made through MATLAB software.
The figure flowchart shows and explain the algorithm.

Start

Import Grades

Identify the raw score


location of the cell.

Use the formula to YES NO


Score Use the formula to
compute grades 60 and
>=60 compute grades below 60.
above.

Merge the score in


table.

Get the product of score


and overall percentage.

Designate equivalent
End grade to final grade.
From the figure above, presents a rating estimation algorithm flowchart. When the
program starts, the Excel spreadsheet folder "levels" will be imported. Next, the cell location is
identified for the raw score. The software tests if the score is 60 or higher. If the condition is true,
the formula will be used to calculate grades 60 and above. Thus, if the condition is incorrect, the
equation will be used to measure grades below 60. The score in the table is combined after the
estimate. The rating is determined by the total percentage in the column. Then the same grade
will be the final grade that will conclude the course.
MATLAB codes
1 % Casilao, Princess Lheakyrie
2 % ECE 2102
3 % MATLAB Activity 1
4 % Grade Computation Algorithm
5 GRADES = readable (‘grades.xlsx’)
6 Scores1stT=GRADES (1:24,4:12)
7 ScoresA=table2array (Scores1stT)
8 first=ScoresA
9 first(first>=60)= -58.33/(5/12)
10 first=(((first/100)*100)*5/12)+58.33
11 second=ScoresA ;
12 second(second<60)=-37.5/(5/8)
13 second=(((second/100)*100)*5/8)+37.5
14 ScoresB = first + second
15 Percentage =
[0.1500,0.1000,0.1000,0.1000,0.1000,0.0500,0.0500,0.1500,0.2000]1
16 ScoresC=ScoresB.*Percentage
17 FinalGrade=ScoresC(:,1)+ScoresC(:,2)+ScoresC(:,3)+ScoresC(:,4)
+ScoresC(:,5)+ScoresC(:,6)+ScoresC(:,7)+ScoresC(:,8)+ScoresC(:,1
18 EquivalentGrade = FinalGrade
19 EquivalentGrade(EquivalentGrade>=88)=1.75
20 EquivalentGrade(EquivalentGrade>=85)=2.00
21 EquivalentGrade(EquivalentGrade>=83)=2.25
22 EquivalentGrade(EquivalentGrade>=80)=2.50
23 GRADES.FinalGrade=FinalGrade
24 GRADES.EqGrade=EquivalentGrade

MATLAB used the above codes to construct a level computing algorithm. Line 1 to 4
defines the event name, title and definition. Line 5 was used to index the component needed from
the table of the spreadsheet. The next line turns the indexed table into an array that allows data to
be manipulated easily. In row, from the array made, the variable "first" was initialized. Then the
"second" variable was initialized from the array generated.
Line 9 up to line 13 has the formula used by Batangas State University's grading system.
In line 14, two arrays combined into one array were first computation and second computation.
Array was created for the percentages and multiplication of the elements was used to add the
percentage to the corresponding column. The table has been converted to the array. Line 1 to 9
was grouped in line 17 to get the final grade.
The Equivalent Grade was also initialized as FinalGrade in row 18. The new table was
then transformed to a set. Line 19 notes that values greater than or equal to 88 have been indexed
and the value is adjusted to 1.75. The values greater than or equal to 85 were indexed in line 20
and the value was changed to 2.00. Line 21 communicates values that are greater than or equal to
83 and adjusts the value to 2.25. The values greater than or equal to 80 are indexed in line 22,
and the value was changed to 2,50. In line 23, the original table initiated as FinalGrade was
applied to a new component. In line 24, the original table initiated as EquivalentGrade was
applied to a new component.
In this activity, it has been shown that the MATLAB is particularly helpful with solving
these kinds of data. In addition, using the computing grade equation was taught here. The event
also provided a clear understanding of the rating system.

S-ar putea să vă placă și