 <p><strong>EDIT (BENCHMARKING):</strong> Since several solutions (including mine below) have been suggested, here is some rough benchmarking to compare the different solutions, using larger arrays:</p> <pre><code>a=1:10; N=1000; timers=zeros(N,6); for ii=1:N; C=rand(400); tic; out = repmat(C,[1,1,numel(a)]).*reshape(repelem(a,size(C,1),size(C,2)),[size(C),numel(a)]); timers(ii,1)=toc; tic; out = bsxfun(@times,C,reshape(a,1,1,[])); timers(ii,2)=toc; tic; out = reshape(C(:)*a, size(C,1), size(C,2), numel(a)); timers(ii,3)=toc; tic; out = bsxfun(@mtimes,C,permute(a,[3,1,2])); timers(ii,4)=toc; tic; out = reshape(bsxfun(@mtimes, C(:), a(:).'), [size(C),numel(a)] ); timers(ii,5)=toc; tic; out = reshape(kron(a,C),[size(C),numel(a)]); timers(ii,6)=toc; end; mean(timers) ans = 0.0080863 0.0032406 0.0041718 0.015166 0.0074462 0.0033051 </code></pre> <p>... suggesting that @hbaderts solution is fastest, then @Adiel's, then @Luis Mendo's, then @thewaywewalk's (1), then mine, then @thewaywewalk's (2). </p> <p><strong>My solution:</strong></p> <p>Another option, using <a href="http://www.mathworks.com/help/matlab/ref/repmat.html" rel="nofollow"><code>repmat</code></a> and <a href="http://www.mathworks.com/help/matlab/ref/reshape.html" rel="nofollow"><code>reshape</code></a> (no <code>bsxfun</code>):</p> <pre><code>out = repmat(C,[1,1,numel(a)]).*reshape(repelem(a,size(C,1),size(C,2)),[size(C),numel(a)]) out(:,:,1) = 1 2 3 4 5 6 7 8 9 out(:,:,2) = 2 4 6 8 10 12 14 16 18 </code></pre> <p><strong>This is the element-wise multiplication of two arrays.</strong> The first is your original matrix <code>C</code> repeated <code>numel(a)</code> times in the third dimension:</p> <pre><code>repmat(C,[1,1,numel(a)]) ans(:,:,1) = 1 2 3 4 5 6 7 8 9 ans(:,:,2) = 1 2 3 4 5 6 7 8 9 </code></pre> <p>The second is the same size as the first, with each slice containing the corresponding element of <code>a</code>:</p> <pre><code>reshape(repelem(a,size(C,1),size(C,2)),[size(C),numel(a)]) ans(:,:,1) = 1 1 1 1 1 1 1 1 1 ans(:,:,2) = 2 2 2 2 2 2 2 2 2 </code></pre>