Vector Function to calculate grades

I need a MATLAB function that will output a vector which is derived from a matrix of grades in a course.
The maxtrix is as follows:
10 6 8 10 18 30
9 8 12 9 16 35
7 10 9 7 9 41
Each row represents one student. The first four numbers in a row represent assignment grades out of 10. You must take the top 3 out of 4 grades on the assignment. The fifth number represents the midterm grade which is out of 20 and the last number represents the final exam grade out of 50. The assignments are worth 30% of the grade, the midterm is worth 20 % and the final is worth 50%. I need a vector that will out the grades of these 3 students.

1 Kommentar

Cedric
Cedric am 6 Apr. 2013
It seems to me that you defines max points to reflect these percents that you provide in the end already..?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Cedric
Cedric am 6 Apr. 2013
Bearbeitet: Cedric am 6 Apr. 2013

0 Stimmen

Assuming that my comment above is valid and that the full matrix of point is P, you can get the sum of points per student as follows:
>> P % All points.
P =
10 6 8 10 18 30
9 8 12 9 16 35
7 10 9 7 9 41
>> HW = sort(P(:,1:4), 2) % Sorted homework.
HW =
6 8 10 10
8 9 9 12
7 7 9 10
>> Ps = [HW(:,2:end), P(:,5:6)] % Selection of 3 best HW, MT, final.
Ps =
8 10 10 18 30
9 9 12 16 35
7 9 10 9 41
>> sum(Ps, 2) % Total points per student (max=100).
ans =
76
81
76
Then you can do whatever is needed to rescale to relevant grades, e.g. divide by 100, multiply by 6 (?), etc.

Weitere Antworten (0)

Kategorien

Tags

Gefragt:

am 6 Apr. 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by