%% Multiply Matrix and 3-D Array
% Create a matrix A and a 3-D array Y, and then multiply each page of the 3-D array with the matrix.

A = magic(3)
rng default
Y = randi([1 10],3,3,3)
Z = pagemtimes(A,Y)

% The ith page of the output Z(:,:,i) is formed by multiplying A*Y(:,:,i).
% Copyright 2020 The MathWorks, Inc.