Problem 44960. Rescale Scores
Solution Stats
Problem Comments
-
11 Comments
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.
yes true, thank you
Thank you! Modified the problem statement.
Why doesn't it work?
function X = rescale_scores(X)
X = [X(1:end,1:end-1) (X(1:end,end).-60)./4]
end
A little bit of math work will make your program much simpler. Grade 60-100 for GPA 0 - 4, this is a straight line! The equation for this straight line is GPA = 0.1*(grade-60). Don't forget to take care of negative GPAs.
X(:,end)=mean(rescale(X(:,end-1),-6,4,'InputMin',0,'InputMax',100),2);
Don't forget the negative numbers.
Score GPA
90 - 100 3 - 4
80 - 90 2 - 3
70 - 80 1 - 2
60 - 70 0 - 1
50 - 60 -1 - 0
40 - 50 -2 - -1
30 - 40 -3 - -2
20 - 30 -4 - -3
10 - 20 -5 - -4
0 - 10 -6 - -5
I am getting confused. IIs there a capital and small "x" in use. Getting errors.
Below 60 GPA=0, so why there could be any negative value?
"Assume that no student in this class has scored below 60." - not true in the test cases!
I am with jklebes
"Assume that no student in this class has scored below 60." - not true in the test cases!
The test suite has been corrected.
Solution Comments
-
1 Comment
I think there's a problem with the third test case with the correct input being y_correct = [100 90 95 3.5;...
70 80 60 1.5;...
80 70 90 2.0;];
-
1 Comment
I think assertion 3 has a wrong average grade. My code worked on all assumptions except the third. Unless the point was to only use the average score at the end and not need to recalculate the average score again.
-
2 Comments
I may be bad at programming, but at least I can do math
Lol. Or as I like to believe, Programming is just Maths in computer language
-
1 Comment
worth to do
-
1 Comment
good problem
-
2 Comments
The problem states "Score less than 60: GPA = 0"
But the solution assigns negative values to scores under 60.
So the provided solutions are wrong!
Good question
-
1 Comment
A couple of if
-
2 Comments
Nice question. Checks our understanding.
Really sort of a nice problem here. Nice problem. Nice solution. Nice
-
1 Comment
Easy!
-
1 Comment
Plot the GPA vs score to get the equation.
-
3 Comments
Please, what is wrong with the following answer
X = (X-60)/10;
thank u
This would operate on the entire matrix X. However we want the GPA to appear only in the last column of X. So try by declaring another variable which would calculate the GPA and then replace the last column of X with this column vector.
We have to modify only last column of matrix X not an entire matrix so find GPA for that column only.
Problem Recent Solvers4619
Suggested Problems
-
1045 Solvers
-
8357 Solvers
-
Return fibonacci sequence do not use loop and condition
421 Solvers
-
225 Solvers
-
398 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!