Need help manually finding the standard deviation using an external function
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kelley Kehoe
le 2 Oct 2020
Commenté : Kelley Kehoe
le 3 Oct 2020
I am new to matlab (taking an intro to matlab class), but for my assignment I have to do a number of things including randomly generating 10 scores for each of 25 students. Then take the median, mean, and standard deviation for each student's scores. For median and mean I used median(Score,2) and mean(Score,2) to find the values for each row (individual student's 10 scores). I am struggling to figure out how to manually find the standard deviation for each student. I also have to use Matlab functions to find the std and compare it to the manual calculation. The part I am inquiring about is part D in the code. I know I probably dont have it right at all this is just my starting point from looking stuff up online. Any help would be appreciated, thanks.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369646/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369646/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369643/image.png)
0 commentaires
Réponse acceptée
Ameer Hamza
le 2 Oct 2020
Modifié(e) : Ameer Hamza
le 2 Oct 2020
It should be something like this
z = sqrt(1/N*sum((Score - mean_student).^2, 2))
5 commentaires
Ameer Hamza
le 2 Oct 2020
MATLAB uses following formula for std
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/369781/image.png)
The difference is division by N-1 in this case. In your formula, there is a division by N. This is an unbiased estimator of standard deviation. Your formula is a biased estimator. Both are equally valid, and you should use the one given to you. Read the discussion here: https://en.wikipedia.org/wiki/Standard_deviation#Estimation.
You cannot make the MATLAB's std result match your formula.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!