MATLAB: 3D matrix multiplication

3d matrix multiplication

Hi,
I have two 3D matrices that I need to multiply in a specific way. I need to do for k=1:Z M(:,:,k)=A(:,:,k)*B(:,:,k) end
but I do not want to use for loop because it makes my code run slower and I need to this multiplication for a unsteady flow profile calculation (close to million time steps). Is there a more efficient way to do it?
Related Question