Problem 44960. Rescale Scores
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
Problem Comments
-
16 Comments
Show
13 older comments
Francesco
on 8 Oct 2023
This problem is actually better off without the function rescale. And to say it all the rescale function itself is more something for the uneducated in basic arithmetics,
shuo shang
on 26 Dec 2023
Test 3 should be 70 80 60 70
Juan
on 18 Nov 2024
Dear MATLAB & Cody friends, I had a issue with the values of test 3, where it says that the score for the 2 row it should be 1.5... but for that case, thw values on the Entry Data table should be: 70-80-75-75 or any mix of those value.
If anyone of the Cody program can check this out, it would be great for the upcoming students.
Solution Comments
Show commentsGroup

High School Challenge
- 50 Problems
- 98 Finishers
- Times 2 - START HERE
- Add two numbers
- Laws of motion 3
- Laws of motion 6
- Force and Motion 2
- Force and Motion 3
- Velocity Conversion
- Potential energy calculation
- An Ohm's Law Calculator
- Electrical Diode Current Calculation
- Resistance of a light bulb
- Calculate Parallel Resistance
- Current through resistor
- Energy Conversion 2
- Mass Conversion 1
- Convert from Fahrenheit to Celsius
- Return area of square
- Area Conversion 1
- Create times-tables
- Triangle Numbers
- How long do each of the stages of the rocket take to burn?
- Finding Perfect Squares
- Magnitude of Balancing Force
- Mechanical Advantage of a Gear Train
- Calculate load on arm 1
- Find the mass of a rod
- Find the force required to support a lever
- Coefficient of Kinetic friction
- Calculate the acceleration of a crate
- Coefficient of Sliding Friction
- Coefficient of Static friction
- Linear Motion 1
- Linear Motion 2
- Linear Motion 3
- Linear Motion 4
- Linear Motion 5
- Linear Motion 6
- Linear Motion 7
- Basic Mathematics 1
- Basic Mathematics 2
- Basic Mathematics 3
- Basic Mathematics 4
- Basic Mathematics 5
- Basic Mathematics 6
- Basic Mathematics 7
- Basic Mathematics 8
- Resistance of a robot
- Voltage in a lamp
- Resistance in a circuit
- Calculate supply voltage and total current
Problem Recent Solvers6447
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!