Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Variance of all values in a matrix
Date: Fri, 18 Nov 2011 21:36:28 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <ja6j4s$f61$1@newscl01ah.mathworks.com>
References: <ja6h54$8d9$1@newscl01ah.mathworks.com> <ja6hth$b2b$1@newscl01ah.mathworks.com> <ja6ifn$d33$1@newscl01ah.mathworks.com> <ja6ihp$dam$1@newscl01ah.mathworks.com> <ja6ir2$e6k$1@newscl01ah.mathworks.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1321652188 15553 172.30.248.46 (18 Nov 2011 21:36:28 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Nov 2011 21:36:28 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:749816

"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <ja6ir2$e6k$1@newscl01ah.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <ja6ihp$dam$1@newscl01ah.mathworks.com>...
> > 
> > 
> > "Ulrik Nash" <uwn@sam.sdu.dk> wrote in message 
> > news:ja6ifn$d33$1@newscl01ah.mathworks.com...
> > > "ade77 " <ade100a@gmail.com> wrote in message 
> > > <ja6hth$b2b$1@newscl01ah.mathworks.com>...
> > >> "Ulrik Nash" <uwn@sam.sdu.dk> wrote in message 
> > >> <ja6h54$8d9$1@newscl01ah.mathworks.com>...
> > >> > Is there an expression for finding the variance of all elements in a 
> > >> > matrix? If so, what is it?
> > >>
> > >> doc var
> > >
> > > I was hoping the doc was incomplete. I need the variance not simply of a 
> > > row or column, but for all values at once. Surely MatLab can do this, 
> > > right?
> > 
> > Columnize the matrix.
> > 
> > A = magic(7);
> > var(A(:))
> 
> Thank you very much, Steve. That really should be in the documentation.


On the other hand, I really should have known about columnize. If I did, the rest would have been obvious! :)