function C = dotmatprod(A,B)
% Direct computation of entries of C by forming scalar products of columns
% of $\VB$ and rows of $\VA$.
  [n,k] = size(A); % A is an $n\times k$-matrix
  [kb,m] = size(B); % B is an $k\times m$-matrix
  if (k ~= kb), error('Mismatch of matrix dimensions'); end
  C = zeros(n,m);
  for i=1:n
    for j=1:m
        C(i,j) = dot(A(i,:),B(:,j)); % Note: access to rows and columns through
                                     % range operator :
    end
  end
end
