Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Very quick question about if then statements and standard deviation?
Date: Thu, 2 Dec 2010 04:05:21 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <id75u1$q3f$1@fred.mathworks.com>
References: <id6vbg$pjp$1@fred.mathworks.com> <id730d$jff$1@fred.mathworks.com> <id741g$pd5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1291262721 26735 172.30.248.38 (2 Dec 2010 04:05:21 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 2 Dec 2010 04:05:21 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:691782

"Laurentiu Galan" <larryg003@yahoo.com> wrote in message <id741g$pd5$1@fred.mathworks.com>...
> ......
> I suppose you wouldn't know by any chance how to loop with groups of k? Not just 3 that is?
- - - - - - - - -
  Provided you don't run into memory problems, do this:

 M2 = zeros(size(M1));
 M2(k:end) = std(hankel(M1(1:end-k+1),M1(end-k+1:end)),0,2);

Otherwise you'll have to use a for-loop to take the standard deviations one at a time.

Roger Stafford