[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
subsums
From: |
Gorazd Brumen |
Subject: |
subsums |
Date: |
Sun, 06 Feb 2005 17:42:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 |
Hi,
How do you form a vector of subsums of a certain vector without the for
loop?
Example:
Let x = [1 2 3 4 5 6 7 8 9 10]
I want to get a vector that would have as entries
sum([1 2 3 4 5]) and sum ([6 7 8 9 10])?
Or is the solution with the for loop not slower?
Thanks,
g.
--
Gorazd Brumen
Mail: address@hidden
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240
-------------------------------------------------------------
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
-------------------------------------------------------------
- subsums,
Gorazd Brumen <=