Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!c13g2000yqk.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Dividing a Matrix into submatrices
Date: Thu, 26 Jan 2012 22:09:47 -0800 (PST)
Organization: http://groups.google.com
Lines: 23
Message-ID: <c8e60e6c-8df6-40cf-9474-3858ae9fba2c@c13g2000yqk.googlegroups.com>
References: <jft8lq$3n6$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 12.97.42.34
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1327644587 7922 127.0.0.1 (27 Jan 2012 06:09:47 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 27 Jan 2012 06:09:47 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c13g2000yqk.googlegroups.com; posting-host=12.97.42.34; posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESNKRC
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:755930

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).