Can someone tell me how to do the following in matlab (R2010a):
thanx in advance.
I assume that you have already defined the contents of the vector f of length n.
p = prod(f);
I have a 4d matrix M, with size: a * b * c * n
This is exactly what I want: M(:,:,:,1).*M(:,:,:,2).*....*M(:,:,:,n) (this is element wise multiplication of the elements)
Read Matlab's Help entry, which tells you exactly how to take the product over a desired dimension (index). I will help you if you're stuck, but I will not do all your work for you.
Separate names with a comma.