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

Cedric
Cedric 2013년 4월 6일
It seems to me that you defines max points to reflect these percents that you provide in the end already..?

댓글을 달려면 로그인하십시오.

 채택된 답변

Cedric
Cedric 2013년 4월 6일
편집: Cedric 2013년 4월 6일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dynamic System Models에 대해 자세히 알아보기

태그

질문:

2013년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by