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

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 % function Z=rdiv(X,Y)
wolffd@0 2 %
wolffd@0 3 % row division: Z = X / Y row-wise
wolffd@0 4 % Y must have one column
wolffd@0 5
wolffd@0 6 function Z=rdiv(X,Y)
wolffd@0 7
wolffd@0 8 [N M]=size(X);
wolffd@0 9 [K L]=size(Y);
wolffd@0 10 if(N ~= K | L ~=1)
wolffd@0 11 disp('Error in RDIV');
wolffd@0 12 return;
wolffd@0 13 end
wolffd@0 14
wolffd@0 15 Z=zeros(N,M);
wolffd@0 16
wolffd@0 17 if M<N,
wolffd@0 18 for m=1:M
wolffd@0 19 Z(:,m)=X(:,m)./Y;
wolffd@0 20 end
wolffd@0 21 else
wolffd@0 22 for n=1:N
wolffd@0 23 Z(n,:)=X(n,:)/Y(n);
wolffd@0 24 end;
wolffd@0 25 end;