finding mean scores of students tests compared to rest of class
Show older comments
Hello, I am working on this problem. To give you some context, there is an 150x10 array of test scores ranging from 1-10. sNum is the student number.
Assign to the variable curveBusters an S-by-1 array (S may be 0) of the student numbers whose average score (across all tests) was strictly higher than average score of the student indicated by sNum.
Here is my code
curveBusters = find(mean(Grades(sNum,:)) < mean(Grades(:,:)));
There was a previous problem
Assign to the variable betteredBy an S-by-1 array (S may be 0) of the student numbers that got a strictly higher score than the student indicated by sNum on the test indicated by testNum.
and this was my code that is correct
betteredBy = find((Grades(sNum,testNum) < (Grades(:,testNum))));
So I can't figure out what is wrong with my code for the means.
Accepted Answer
More Answers (1)
Joseph Cheng
on 18 Jun 2014
0 votes
well in your curve busters equation you have the find() function looking for the students that are performing less than (<) the mean of the grades. They wouldn't be curve busting right? Those would be curve helpers.
5 Comments
Rick
on 18 Jun 2014
Joseph Cheng
on 18 Jun 2014
Edited: Joseph Cheng
on 18 Jun 2014
NVM... the question was confusing... sNum is a specific student.
Joseph Cheng
on 18 Jun 2014
the
curveBusters = find(mean(Grades(sNum,:)) < mean(Grades(:,:)));
mean portion has the mean is taking the mean of all the columns.. such that you'll get a 1x10 result. which will be finding which test performed better than the average of student sNum.
You'll need to take the mean(Grades,2) which the average of the rows. this will get you the 150x1 matrix. or the average of each student's test scores.
Joseph Cheng
on 18 Jun 2014
I got confuses with the line sNum is the student number so i was thinking sNum was 1:150 not a specific student. if sNum was 1:150 which would then be which students score better than average as they would be curve busters.
is the sNum specified in the question someone in the middle of the curve?
Rick
on 18 Jun 2014
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!