sum(m)

The sum(m) function returns a row vector where each element is the sum of each column in m.

Example

OML

>> m=[1 -2;-3 4]

1 -2

-3 4

>> sum(m)

-2 2