MATLAB: 3D Array Multiplication with 2D Matrix

2d3darray multiplication

Hi,
I have a 3D array of lets say 500:10:32 elements. I want to multiple the first dimension of lthis array with another 1:500 matrix. How would I do this?
Regards

Best Answer

data1=rand(500,10,32);% 3D Array
data2=rand(1,500); %1x500 mat
result=data1(1:500,1,1)*data2; %Multiplication