Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Divide, operate and reassemble matrix
Date: Thu, 18 Jun 2009 21:41:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 53
Message-ID: <h1ec9d$d16$1@fred.mathworks.com>
References: <h1eb7l$531$1@fred.mathworks.com> <728fb21e-1182-4780-b27d-44a4d369d85f@o21g2000prn.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245361261 13350 172.30.248.37 (18 Jun 2009 21:41:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 18 Jun 2009 21:41:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1875128
Xref: news.mathworks.com comp.soft-sys.matlab:548775


Oh, because when I run whatever I wrote, I got the following error

??? Error using ==> minus
Maximum variable size allowed by the program is exceeded.

Error in ==> [some program] at 18
   [equation involves matrix .*, ./ and (1 - some matrix .^)]

However, when I tested on a smaller matrix, the code works
So I was thinking maybe if I divide the matrix into submatrices, do the thing and reassemble them, the code might work.

Thanks 
Diego   

Nathan <ngreco32@gmail.com> wrote in message <728fb21e-1182-4780-b27d-44a4d369d85f@o21g2000prn.googlegroups.com>...
> On Jun 18, 2:23?pm, "Diego Lass" <dlISC...@gmail.com> wrote:
> > Hi
> > I have a problem with a large matrix, what I want to do is to divide the matrix into 4 submatrices, do some operation then reassemble the submatrix together. A toy example
> >
> > A = [1 2 3 ; 3 4 5 ; 2 3 4; 5 1 2 ]
> > A =
> >
> > ? ? ?1 2 3
> > ? ? ?3 4 5
> > ? ? ?2 3 4
> > ? ? ?5 1 2
> > ?I want to divide A into ANY 4 approximately equal sized partitions, for example
> > 1 2
> > 3 4
> >
> > 3
> > 5
> >
> > 2 3
> > 5 1
> >
> > 4
> > 2
> >
> > then do some operation, say add 2 to each element. Then reassemble them together, to get
> >
> > ? ? ?3 4 5
> > ? ? ?5 6 7
> > ? ? ?4 5 6
> > ? ? ?7 3 4
> > What is the most efficient way of doing this?
> > Thanks
> > Diego
> 
> You just posted this not an hour ago with a different title... Why?
> 
> Why disassemble and do operations when you can just do that operation
> to each element in one instruction?