prob3 - Store the answer in the % variable...

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

View Full Document Right Arrow Icon
% 8/29/2009 5:40 PM % Script Name: prob3 % Script Variables: % 1. colSum - A row vector of sums of columns of "arr". % 2. rowAvg - A column vector of averages of rows of "arr". % 3. arrMax - The maximum of "arr". % % Problem Statement: % In the given "prob3" script is an array "arr" that is 5x25. % % (a) Find the sum of each column. The output should be a row vector % (1xN). Store you answer in the variable "colSum". % % (b) Find the average (mean) of each row. The output should be a column % vector (Mx1). Store your answer in the variable "rowAvg". Hint: % Use the transpose operator. % % (c) Find the maximum of the entire array.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Store the answer in the % variable "arrMax". % DO NOT MODIFY ARR arr = [76,96,85,36,36,30,9,14,18,61,46,83,12,88,44,15,86,9,43,50,79,15,25,18,56; 27,56,27,21,84,76,7,58,80,28,10,55,97,10,92,88,63,25,6,35,40,95,36,66,31; 52,15,82,26,59,76,54,48,32,66,24,100,2,41,20,59,36,14,91,91,25,96,83,74,75; 71,16,26,62,56,39,79,3,54,70,92,9,78,27,28,56,52,20,95,38,41,58,3,66,20; 90,27,93,48,92,58,94,35,18,76,17,45,82,81,16,16,41,25,50,13,11,7,6,46,69]; % Start coding here colSum = sum(arr); rowAvg = mean(arr')'; arrMax = max(max(arr));...
View Full Document

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

Ask a homework question - tutors are online