Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/Zoubin/rsum.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
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 |