gradeAverages - array_with_all=[array_grades avg_row;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function array_with_all=gradeAverages(array_grades) %function to find the average of each row, each column, and the entire %array, and place the row averages at the far-right and the column averages %at the bottom and the total average in the bottom-right corner %usage: array_with_all=gradeAverages(array_grades) avg_col=mean(array_grades(:,:)); %finds the average of the columns avg_row=mean(array_grades(:,:)')'; %finds the average of the rows avg_array=mean(mean(array_grades)); %finds the average of the entire array; take the mean(mean in order to get %the mean of the mean of the columns
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: array_with_all=[array_grades avg_row; [avg_col avg_array]]; %places the row averages at the end of the columns %places the column averages at the end of the rows %places the array average at the bottom corner of the new array %you have to add the column of row averages first, because the columns will %need to be concatenated before the rows, because they have the same number %of rows as the original array; vertically concatenate the row of column averages concatenated %with the total average in order to keep the dimensions in the form of a %rectangle...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online