However, I want to generalise this, to multiplying more than 2 planes in the 3rd dimension. I've tried >> a(:,:,2) = cellfun(@times,a(:,:,[1 3]),'Uni',0) ??? Error using ==> times Not enough input arguments.
I've also tried cellfun(@(x) prod(x,3), a(:,:,[1 3]), 'UniformOutput', 0).
But these are giving me errors, or not what I want.