Definite product in matlab


by dunyali
Tags: definite, matlab, product
dunyali
dunyali is offline
#1
Mar19-12, 03:14 PM
P: 2
Can someone tell me how to do the following in matlab (R2010a):

f(1)*f(2)*...*f(n)

thanx in advance.
Phys.Org News Partner Science news on Phys.org
SensaBubble: It's a bubble, but not as we know it (w/ video)
The hemihelix: Scientists discover a new shape using rubber bands (w/ video)
Microbes provide insights into evolution of human language
marcusl
marcusl is offline
#2
Mar20-12, 01:39 PM
Sci Advisor
PF Gold
P: 2,020
I assume that you have already defined the contents of the vector f of length n.
Then
p = prod(f);
dunyali
dunyali is offline
#3
Mar21-12, 01:34 PM
P: 2
Hi, marcusl

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)

Please help.

marcusl
marcusl is offline
#4
Mar21-12, 02:05 PM
Sci Advisor
PF Gold
P: 2,020

Definite product in matlab


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.


Register to reply

Related Discussions
integration of a product of legendre polynomials in matlab Math & Science Software 1
triple scalar product: matlab Math & Science Software 5
Eigenvalues of Positive Definite matrices - &MATLAB.. Math & Science Software 3
Using Matlab to find the cross product of variables? Math & Science Software 1
Definite product of zero and infinity? General Math 35