You could convert your A
matrix into a cell array. First you are going to want to create an N-element array of your matrix dimension (15) for specifying the sizes of your cells:
dimArray = repmat(15, 1, N); % 1xN array of the number 15
Next you will call mat2cell
on your matrix A
to convert it into a cell array where each cell is a 15xM submatrix of A:
newA = mat2cell(A, dimArray);
Finally, call cellfun
on the cell array to do your multiplication:
result = cellfun(@(x) B*x, newA, 'UniformOutput', false);
Which should give you a cell array result
containing the result of B*A(block)
for each block in your A
matrix. You can probably put this all in one line, or at most two:
result = cellfun(@(x) B*x, mat2cell(A, repmat(15, 1, N)), 'UniformOutput', false);
Not the clearest code to read though. This seems like a somewhat round-about way of doing it. If somebody gets it to work with repmat
or similar then that might be the better way to go.