about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/examples/static/Zoubin/rdiv.m
blob: 3128061ed5a8a626e0fb83948171ad82c66b98ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% function Z=rdiv(X,Y)
%
% row division: Z = X / Y row-wise
% Y must have one column 

function Z=rdiv(X,Y)

[N M]=size(X);
[K L]=size(Y);
if(N ~= K | L ~=1)
  disp('Error in RDIV');
  return;
end

Z=zeros(N,M);

if M<N,
  for m=1:M
    Z(:,m)=X(:,m)./Y;
  end
else
  for n=1:N
    Z(n,:)=X(n,:)/Y(n);
  end;
end;