Each column (except last) of matrix X contains students' scores in a course assignment or a test. The last column has a weighted combination of scores across all the assignments and tests.
Replace the elements in the last column of this matrix with a GPA calculated based on the following scale:
Score GPA 90 - 100 3 - 4 80 - 90 2 - 3 70 - 80 1 - 2 60 - 70 0 - 1 Below 60 0
Assume that no student in this class has scored below 60. Also note that the mapping in the range [60, 100] is linear.
See https://www.mathworks.com/help/matlab/ref/rescale.html
Example
Input:
100 90 95 95 70 50 60 60 80 70 90 80
Output:
100 90 95 3.5 70 50 60 0.0 80 70 90 3.0
It appears the last column of the output from the problem statement should be 3.5; 0.0; 2.0 instead of 3.5; 0.0; 3.0, but the first test suite does have it correct.
397 Solvers
Project Euler: Problem 1, Multiples of 3 and 5
1063 Solvers
middleAsColumn: Return all but first and last element as a column vector
316 Solvers
273 Solvers
298 Solvers