From help-request at octave dot org Sun Feb 6 10:37:45 2005 Subject: subsums From: Gorazd Brumen To: help at octave dot org Date: Sun, 06 Feb 2005 17:42:24 +0100 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: brumen at isb dot unizh dot ch 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 -------------------------------------------------------------