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 22:03:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 67
Message-ID: <h1edil$53h$1@fred.mathworks.com>
References: <h1eb7l$531$1@fred.mathworks.com> <728fb21e-1182-4780-b27d-44a4d369d85f@o21g2000prn.googlegroups.com> <092599c9-0913-410c-8f88-cc3911772334@x31g2000prc.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245362581 5233 172.30.248.35 (18 Jun 2009 22:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 18 Jun 2009 22:03:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1875128
Xref: news.mathworks.com comp.soft-sys.matlab:548778


Well, I want to calculate the t-stat of a correlation matrix, i.e.

Tstat = correlation .* sqrt((nv-2) ./ (1 - correlation.^2));

nv is the degree of freedom.  I am not sure how to do that with bsxfun.

Diego


Nathan <ngreco32@gmail.com> wrote in message <092599c9-0913-410c-8f88-cc3911772334@x31g2000prc.googlegroups.com>...
> On Jun 18, 2:41?pm, "Diego Lass" <dlISC...@gmail.com> wrote:
> > 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 <ngrec...@gmail.com> wrote in message <728fb21e-1182-4780-b27d-44a4d369d...@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?
> 
> Are you using bsxfun?
> If not, check that out. It might be what you're looking for.