Q:

The matrix variable rainmat stores the total rainfall in inches for some districts for the years 2010-2013. Each row has the rainfall amounts for a given district. For example, if rainmat has the value:

0

The matrix variable rainmat stores the total rainfall in inches for some districts for the years 2010-2013. Each row has the rainfall amounts for a given district. For example, if rainmat has the value:

>> rainmat

ans =

 25 33 29 42

 53 44 40 56

 etc.

district 1 had 25 inches in 2010, 33 in 2011, etc. Write expression(s) that will find the number of the district that had the highest total rainfall for the entire four year period. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

>> rainmat = [25 33 29 42; 53 44 40 56];

>> large = max(max(rainmat))

large =

 56

>> linind = find(rainmat== large)

linind =

 8

>> floor(linind/4)

ans =

 2

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now