samer@23: function o=sum(A,DIM), samer@23: if nargin<2, o=map(@sum,A); samer@23: else o=map(@(x)sum(x,DIM),A); samer@23: end samer@23: end samer@3: