[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help on calculating sum of combinations
From: |
sanjiv kapur |
Subject: |
help on calculating sum of combinations |
Date: |
Wed, 08 Oct 2003 22:49:56 +0530 |
hello
i am a newbie for using octave (on rh9.0) ,though used a little matlab
before.may i request help in solving the problem as under,in case a function
has been developed by somebody.for a matrix or an array,i want to calculate
the sum of various combinations, i.e
if A=[2, 3, 4, 5, 6, 7], how do i get
a1=2+3+4+5+6+7
a2=2*3+2*4+2*5+2*6+2*7+3*4+3*%+3*6+3*7+4*5+4*6+4*7+...+6*7
a3=2*3*4+2*3*5+2*3*6+2*3*7+2*4*5+2*4*6+2*4*7+2*5*6...+5*6*7
a4=2*3*4*5+2*3*4*6+2*3*4*7+2*3*5*6+...+4*5*6*7
a5=sum of combinations taking five elements at a time
a6=2*3*4*5*6*7
is there a function to calculate the above.please guide me.
thanks and regards
sanjiv
_________________________________________________________________
Make fun prints Click here to order. http://www.kodakexpress.co.in Delivery
anywhere in India.
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------