Lecture20 Review_Exam2_For_Loop_II

Tutorial:
 

  ** Typo in the slides on the left. Should be 'x(i)>0 | x(i)==0'

     

 

     

T_data.xls can be downloaded here
   

   

Tasks:
1. Use a For Loop to calculate the summation of [2 5 6 7 8 8 10 11];
2. Count how many positive numbers are in matrix [4 5 6 7 8 -2 -1 0]; Calculate the avaerage of the positive numbers.
3. Use a For loop to find the maximum value in [4 5 3 2 32 33 45 1 2 ];
4. Use nested For Loops to find the number of negative values in [1 2 3; -3 4 5; 9 -5 3]. (Probably need two counters)




Send your work to the email by Monday.