%columnwise Khatri-Rao product of matrices A and B
function C=krprod(A,B)
[mA,nA]=size(A);
[mB,nB]=size(B);
C=zeros(mA*mB,nA);
for j=1:nA
    C(:,j)=kron(A(:,j),B(:,j));
end
