Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Dividing a Matrix into submatrices
Date: Fri, 27 Jan 2012 06:18:16 +0000 (UTC)
Organization: University of Colorado Denver
Lines: 21
Message-ID: <jftfj8$mfv$1@newscl01ah.mathworks.com>
References: <jft8lq$3n6$1@newscl01ah.mathworks.com> <c8e60e6c-8df6-40cf-9474-3858ae9fba2c@c13g2000yqk.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1327645096 23039 172.30.248.45 (27 Jan 2012 06:18:16 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 27 Jan 2012 06:18:16 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2492023
Xref: news.mathworks.com comp.soft-sys.matlab:755931

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <c8e60e6c-8df6-40cf-9474-3858ae9fba2c@c13g2000yqk.googlegroups.com>...
> On Jan 26, 8:20 pm, "Kevin Ellis" <kevin.elli...@gmail.com> wrote:
> > Hello,
> >
> > I am having a problem using the "mat2cell" command. Suppose I have a 10x10 square matrix and I would like to divide that matrix into a set of 2x2 matrices. So there would be fifteen total submatrices. How would I set up the command for mat2cell to accomplish this?
> >
> > Also for understanding how you perform the same operation on a 6x6 matrix (that way I can see how the mat2cell command will change depending on the size of the square matrix)?
> >
> > Any help would be much appreciated. Thanks.
> >
> > Kevin
> 
> ---------------------------------------------------------------------------
> m = rand(10)
> 
> mCell = mat2cell(m, [2 2 2 2 2], [2 2 2 2 2])
> 
> I trust you can figure out how to make up the [2 2 2 2 2] or [2 2 2]
> vectors (in case you're using 6).

Okay. Great. Thanks for the help.