This bothers me a bit:
Suppose you have a matrix with three layers.
Is there a simple way to multiply this matrix with a vector of three elements so that the
Another way is to repeat vector to match the matrix by size:
out = out.*shiftdim(repmat(vector(:),[1 size(out(:,:,1))]),1)