Contents Previous Next Subchapters

Computing The Sum Of Each Row
Syntax rowsum(x)
See Also sum , colrange , rownorm , colsum

If x is an integer, real, double-precision, or complex matrix, returns a column vector with the same type and row dimension as x containing the sum of each row. If x is a logical matrix, returns an integer column vector (with the same row dimension as x) containing the number of "true" entries in each row.

     x = {[0., 2., 4.], [0., -1., 1.]}