Rescale Scores - MATLAB Cody - MATLAB Central

Problem 44960. Rescale Scores

Difficulty:Rate
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
91 - 100 3 - 4
81 - 90 2 - 3
71 - 80 1 - 2
61 - 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.
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 2.0

Solution Stats

30.83% Correct | 69.17% Incorrect
Last Solution submitted on Mar 17, 2025

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers6448

Community Treasure Hunt

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

Start Hunting!
Go to top of page