A think on sum(X, 1)

Posted by Runner on Stack Overflow See other posts from Stack Overflow or by Runner
Published on 2010-04-16T07:19:20Z Indexed on 2010/04/16 7:23 UTC
Read the original article Hit count: 225

Filed under:
|
>> X = [0 1 2
        3 4 5]

>> sum(X, 1)

ans =

     3     5     7

sum(X, 1) should sum along the 1st dimension(row) as per the document says:

S = SUM(X,DIM) sums along the dimension DIM.

But why does it actually sums along the 2nd dimension(column)?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about dimensions