Path: news.mathworks.com!not-for-mail
From: "Mohammad Monfared" <gohardoust@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to do this in the vector form?
Date: Wed, 21 Jan 2009 17:04:01 +0000 (UTC)
Organization: gol
Lines: 16
Message-ID: <gl7ki1$fhs$1@fred.mathworks.com>
References: <gl7i56$pei$1@fred.mathworks.com> <gl7ive$nrj$1@fred.mathworks.com>
Reply-To: "Mohammad Monfared" <gohardoust@gmail.com>
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 1232557441 15932 172.30.248.37 (21 Jan 2009 17:04:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 21 Jan 2009 17:04:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 93829
Xref: news.mathworks.com comp.soft-sys.matlab:512977


"Matt " <mjacobson.removethis@xorantech.com> wrote in message <gl7ive$nrj$1@fred.mathworks.com>...
> "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)
> 

oh! Great and simple. so thanks!
Is it possible to use the 'trimmean' function in vector form or the 'sort' should be employed?

Reza.