sum(A) produces a row vector containing the row sums of A if A is a matrix. If A is a row vector, it produces the sum of the elements of A.