Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!llnews!53ab2750!not-for-mail
From: Peter Boettcher <boettcher@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sums and loops
References: <flkv6k$fa$1@fred.mathworks.com> <fll0jh$7rt$1@fred.mathworks.com>
Message-ID: <muyabnlbqbg.fsf@G99-Boettcher.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux)
Cancel-Lock: sha1:F7kTsb1hZXAYSpOQPHAVzqQTi50=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 25
Date: Fri, 04 Jan 2008 09:47:31 -0500
NNTP-Posting-Host: 155.34.163.114
X-Complaints-To: news@ll.mit.edu
X-Trace: llnews 1199457577 155.34.163.114 (Fri, 04 Jan 2008 09:39:37 EST)
NNTP-Posting-Date: Fri, 04 Jan 2008 09:39:37 EST
Xref: news.mathworks.com comp.soft-sys.matlab:444342



"Dave " <bocconiluck@yahoo.com> writes:

> thanks for the reply, i explain the question further 
>
> p=[1 2 3 4 5 6 7 8 9]'
>
> we need a code that sums elements in p for ex the first
> three elements at a time resulting in a new column s
>
> s=[6 15 24]'
>
> (6=1+2+3 .. 15=4+5+6 ... 24= 7+8+9 ...)
>
> I tried reshape in didnt work but thanks for the input

1: "How do I put in a nail?"
2: "Use a hammer"
1: "No, I want to put a nail in a piece of wood.  
    The hammer didn't work.  What else can I try?"

You need to be much more specific about how you tried to use the hammer,
and in what way it didn't work.  It's still the right tool, even if it
didn't work for you the first time.

-Peter