Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to do this in the vector form?
Date: Wed, 21 Jan 2009 16:37:02 +0000 (UTC)
Organization: Xoran Technologies
Lines: 11
Message-ID: <gl7ive$nrj$1@fred.mathworks.com>
References: <gl7i56$pei$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232555822 24435 172.30.248.38 (21 Jan 2009 16:37:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 21 Jan 2009 16:37:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:512964


"Mohammad Monfared" <gohardoust@gmail.com> wrote in message <gl7i56$pei$1@fred.mathworks.com>...
> Hi everybody!
> 
> I have a 12 by 200 matrix, say A. I'd like to compute the mean values of each row for non-zero elements. I know some ways to to this job but not the vector form solution. Is there any vector-form answer? 
> 
> thanks,
> Reza.

sum(A,2)./sum(A~=0,2)