comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/Zoubin/rsum.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % row sum
2 % function Z=rsum(X)
3
4 function Z=rsum(X)
5
6 [N M]=size(X);
7
8 Z=zeros(N,1);
9
10 if M==1,
11 Z=X;
12 elseif M<2*N,
13 for m=1:M,
14 Z=Z+X(:,m);
15 end;
16 else
17 for n=1:N
18 Z(n)=sum(X(n,:));
19 end;
20 end