MATLAB Answers

# I have a function to find the standard deviation of a matrix of scores, I now need to use that same standard deviation equation using the mean of said scores and get a scalar in return.

1 view (last 30 days)
Kelley Kehoe on 3 Oct 2020
I asked a question on here a day ago pertaining to an assignment I have, on how to write a function to find the standard deviation (for each student, 25 total) and 10 assignments (randomly calculated) per student. I was able to recieve help on how to do this and was given a 25x1 array output of standard deviation's for each individual student which is correct. But when I apply the same function to the class mean and class median (seperate functions, a later part of the assignment), I also get a 25x1 array when I am looking for a scalar. Any thoughts on how to correct this? I included a picture of my script with the first standard deviation calculation being in Part D. And the need for the second and third standard deviation calculations (class mean, class median) at the end of part E. Also for some reason when i don't suppress the std function in the command window I get a repeating array being displayed, any thoughts to this? Thanks in advance, can elaborate more if need be. The part d and e below are the instructions for the assignment. e. Each student now has a mean assignment-grade. This will be their basic
"semester grade". Calculate the mean of the semester grades of all students -
this will be the "class mean-grade". Calculate the standard deviation (using
the formula) for the class mean-grade. In the same fashion, calculate the
median of all semester grades - this would be the "class median-grade".
Calculate the standard deviation in the for the class median-grade as well. ##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Sulaymon Eshkabilov on 3 Oct 2020
To get mean and median values of the whole class (e.g. Score of size 25-by-10) in one subject (e.g.: assignment # 1) should be computed for each column with: mean(Score(:,1)); median(Score(:,1))
To get mean and median values of all assignments (e.g. Score of size 25-by-10) of one student (student 1) should be computed with: mean(Score(1,:), 2); median(Score(1,:), 2)
To get a mean and median values of all assignments (e.g. Score of size 25-by-10) of all students should be computed with:
mean(Score, 2); median(Score, 2)
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

R2020a

### Community Treasure Hunt

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

Start Hunting!