From: "Sean de " <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matlab 3-d Walk problem
Date: Fri, 19 Nov 2010 19:23:03 +0000 (UTC)
Organization: University of Maine
Lines: 4
Message-ID: <ic6iqn$igi$>
References: <ic4j4j$oqf$> <ic4l4d$1n9$> <ic4mfg$r55$> <ic4nms$fk9$> <ic53un$jf2$> <ic6i0g$o8e$>
Reply-To: "Sean de " <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1290194583 18962 (19 Nov 2010 19:23:03 GMT)
NNTP-Posting-Date: Fri, 19 Nov 2010 19:23:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2256903
Xref: comp.soft-sys.matlab:688446

"Justin Twardowski" <> wrote in message <ic6i0g$o8e$>...
> That method seems better.  For this project, I'm supposed to run through data sets for the number of steps being 100, 1000, 10000 and 100000 so it was taking a while to run.  MY question now is, would there be a way to just return the final value instead of the value after each iteration?  That would be much easier to work with when I have to run my data analysis.

So instead of using cumsum, which updates at each step, just use sum to get the end result?