To find the sum square of an array:
sumSquared = sum(array.^2);
If you have your arrays all together in a matrix:
sumSquaredEachArray = sum(matrix.^2, 1);
sumSquaredEachArray = sum(matrix.^2, 2);
For finding the two lowest scores, let's assume that you have the scores in an array called "sumSquaredEachArray" (which would happen automatically if you have your arrays organized in a matrix)
[~, order] = sort(sumSquaredEachArray);
lowestTwoScores = order(1:2);
sumSquaredEachArrau(lowestScores) = u3;
0 Comments
Sign in to comment.