Etan - isa the 3x3 matrix that you are referring to? If it is, then
sum(a,2)
calculates the sum of each row, returning a 3x1 column vector. Then
[C,I]=max(sum(a,2));
will setC to the max element in that 3x1 vector, withI the index of that max element in the vector (so a value between 1 and 3, since there are three rows).
Best Answer