Q:

Multiply vector with block matrix in matlab

I have a matrix A with dimensions 15NxM. That is, it consists of N different 15xM matrixes stacked on top of each other. 
I also have a vector B with dimension 1x15. 
What I would really like to do is to perform simple matrix multiplication B*A(Block) on each of the N blocks in A, so that I end up with a NxM matrix. 
I need to do this without making any loops, because the main reason I am doing this is to gain some speed.  
Thanks. 

A:

You could try
result = reshape( B * reshape(A, 15, []), N, M);

This avoids ever creating the intermediate "repmat" copy of B; but reshape can be slow.