I have a 3D array and I want to calculate the mean of the first two dimensions along the 3rd dimension but I am getting the following error
"Assignment has more non-singleton rhs dimensions than non-singleton subscripts".
My code looks as follows
MeanMatrix = zeros(1,1,30); ImageROI = data(50:55,100:105,:); for i=1:30 MeanMatrix(:,:,i) = mean(ImageROI(:,:,i)); end
Best Answer