Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: blockwise mean of large matrix
Date: Tue, 30 Dec 2008 20:15:04 +0000 (UTC)
Organization: Xoran Technologies
Lines: 18
Message-ID: <gjdvg8$s79$1@fred.mathworks.com>
References: <82af7ae9-44fd-4745-b85a-ef77ed0693b7@i24g2000prf.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1230668104 28905 172.30.248.38 (30 Dec 2008 20:15:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 30 Dec 2008 20:15:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:509262

soms.sharma@gmail.com wrote in message <82af7ae9-44fd-4745-b85a-ef77ed0693b7@i24g2000prf.googlegroups.com>...
> Greetings!
> 
> I have a 100*100 sized matrix of a variable. Is there some quick ways/
> syntax to get mean of the 10*10 blocks of the original matrix starting
> from the left upper edge?
> Thanks
> Soms

Call the matrix X.

partition=10*ones(1,10);
Xcell=mat2cell(X,partition,partition);
XX=horzcat(Xcell{:});
Means=mean( reshape(XX,100,[])  ,1);