Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: largest magnitude of rows
Date: Sat, 14 Mar 2009 22:53:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <gphcge$jgv$1@fred.mathworks.com>
References: <gph5h9$rod$1@fred.mathworks.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 1237071182 19999 172.30.248.37 (14 Mar 2009 22:53:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 14 Mar 2009 22:53:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:524921

"Hosein" <Kalaeimh@yahoo.com> wrote in message <gph5h9$rod$1@fred.mathworks.com>...
> Is there any function that can choose the largest magnitude of each row in matrix "A"?
> 
> e.g.: A=[ 1 0 3 4;-8 3 7 1;2 3 -1 1]
>         B=?(A)= [4;-8;3]

 [t,p] = max(abs(A),[],2);
 n = size(A,1);
 B = A((1:n)'+n*(p-1));

Roger Stafford