gradeAverages - %finds the average of the rows

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(:,:)');
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %finds the average of the rows avg_array=sum(sum(array_grades))./(length(array_grades).*length(array_grades)'); %finds the average of the entire array array_with_all=[array_grades ; avg_col]; %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...
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 Tech.

Ask a homework question - tutors are online