-->a=fscanfMat('data') a = 20. 35. 44. 37. 39. 37. 30. 43. 44. 27. 54. 49. 53. 42. 44. 58. 55. 37. 53. 46. 56. 46. 53. 59. 53. 49. 65. 43. 74. 53. 59. 60. 54. 52. 78. 74. 59. 70. 79. 62. 89. 74. 75. 65. 85. 59. 83. 84. 76. 78. 90. 91. 86. 71. 87. 91. 75. -->mean(a,'r') ans = 54.736842 62.631579 61.789474 -->stdev(a,'r') ans = 18.958557 18.18183 17.018222 -->size(a) ans = 19. 3. -->b=center(a,1) b = - 34.736842 - 27.631579 - 17.789474 - 17.736842 - 23.631579 - 24.789474 - 24.736842 - 19.631579 - 17.789474 - 27.736842 - 8.6315789 - 12.789474 - 1.7368421 - 20.631579 - 17.789474 3.2631579 - 7.6315789 - 24.789474 - 1.7368421 - 16.631579 - 5.7894737 - 8.7368421 - 9.6315789 - 2.7894737 - 1.7368421 - 13.631579 3.2105263 - 11.736842 11.368421 - 8.7894737 4.2631579 - 2.6315789 - 7.7894737 - 2.7368421 15.368421 12.210526 4.2631579 7.3684211 17.210526 7.2631579 26.368421 12.210526 20.263158 2.3684211 23.210526 4.2631579 20.368421 22.210526 21.263158 15.368421 28.210526 36.263158 23.368421 9.2105263 32.263158 28.368421 13.210526 -->c=b'*b // Note that I forgot to divide by 1/(N-1) [N=19 here] c = 6469.6842 4512.1579 3954.9474 4512.1579 5950.4211 4260.5263 3954.9474 4260.5263 5213.1579 -->[p,d]=spec(c) d = 1286.7455 0. 0. 0. 1948.7978 0. 0. 0. 14397.72 p = - 0.1355251 0.7858125 0.6034332 0.7365276 - 0.3274664 0.5918554 - 0.6626915 - 0.5246565 0.5343926 -->a*p(:,3) ans = 56.296881 65.181919 67.066057 74.43813 80.353165 87.323703 89.133298 90.655432 95.718398 98.067741 99.971089 117.08831 119.24946 129.63305 129.15147 129.61554 140.12099 143.75387 146.43698 -->b*p(:,3) ans = - 46.821828 - 37.936791 - 36.052653 - 28.680579 - 22.765544 - 15.795006 - 13.985411 - 12.463277 - 7.4003108 - 5.0509684 - 3.1476207 13.969598 16.13075 26.51434 26.03276 26.496834 37.002277 40.635158 43.318273 -->b*p(:,3)/sum(p(:,3)) ans = - 27.069628 - 21.932821 - 20.843524 - 16.581424 - 13.161699 - 9.1317435 - 8.0855421 - 7.205534 - 4.2784245 - 2.9201729 - 1.8197692 8.0763998 9.3258508 15.329032 15.050611 15.318911 21.39254 23.492859 25.044078 // Note that this ranking puts student 14 slightly above students 15 and 16. // But the race for 4th place is still too close to call.