[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: max conversion
From: |
Paul Kienzle |
Subject: |
Re: max conversion |
Date: |
Fri, 5 Mar 2004 00:06:34 -0500 |
On Mar 4, 2004, at 11:04 PM, Joe Koski wrote:
I'm converting another Matlab script. It has the statement
f = max(connexe,[],1);
Where, for the example problem, connexe is a 125 x 2000 matrix.
Questions:
What should f be, a 125 x 1 column vector with the maximum values from
each
row of connexe?
What is the equivalent octave expression? (Again, as an old Fortran
programmer, I'd write myself a loop, but is there a more elegant
solution?)
f = max(connexe);
To get the maximum of each row in matlab, you would use
f = max(connexe,[],2). Until octave's max is extended to
handle Nd arrays, use f=max(connexe.') for this.
Paul Kienzle
address@hidden
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- max conversion, Joe Koski, 2004/03/04
- Re: max conversion,
Paul Kienzle <=