Commit d156ba5d by Sylvain CALINON

outerprod.m added

parent cf8c8e33
function T = outerprod(U,V,varargin)
% Computation of the outer product between two tensors.
T = bsxfun(@times,U(:),V(:).');
totalSize = [size(U) size(V)];
for i = 1:numel(varargin)
T = bsxfun(@times,T(:),varargin{i}(:).');
totalSize = [totalSize, size(varargin{i})];
totalSize(totalSize==1) = [];
T = reshape(T, totalSize);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment