help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More DLD mysteries


From: JD Cole
Subject: Re: More DLD mysteries
Date: Mon, 15 Mar 2004 15:28:14 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Al,
This is a shot in the dark, but I imagine any() and all () return a Matrix so that no generality is lost when dealing with N-dimensional matrices.

JD

Al Niessner wrote:

Sorry it took so long, but I am just getting back to this. So, if Matrix
is two dimensional and any() and all() reduce the order by one, then why
do they return a Matrix? ColumnVector and RowVector are the one
dimensional counterparts. I would then think that ColumnVector any() or
all() would reduce to a scalar (boolean actually). However, there is no
any() or all() for {Column,Row}Vector.  So, I have to do something like:

ColumnVector c;

...
c = ...;
if ((Matrix(c) < SomeDelta).bool_matrix_value().any()(0,0))
{
  ...do something significant maybe...
}

The point here being I have no idea if the conditional in the C++ if
statement is the same as my m-file of 'if (any(c < SomeDelta))'. There
is nothing in any header file in the include/octave... directory that
helps to clear it up. It does compile, so we will see.

Thanks for the help.





-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]