help-octave
[Top][All Lists]
Advanced

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

Re: How to leave out selected elements from a vector?


From: Ben Abbott
Subject: Re: How to leave out selected elements from a vector?
Date: Fri, 18 Jul 2008 18:10:19 -0400


On Jul 18, 2008, at 5:28 PM, Jaroslav Hajek wrote:

On Fri, Jul 18, 2008 at 11:17 PM, Shaun Jackman <address@hidden> wrote:
Jaroslav Hajek wrote:

On Fri, Jul 18, 2008 at 7:07 PM, Shaun Jackman <address@hidden> wrote:

Bill Denney wrote:
...

or with a logical vector
mask = false(size(list));
mask(m:n) = true;
list(mask)

Woah! This blows my mind. How does a logical vector differ from a vector
of
integers? Example:


Indexing by a boolean vector b is essentially the same as indexing by find
(b).

How does octave know that the vector is of booleans and not integers? Where
is this type information stored, and how do I display it?


Each high-level (i.e. not internal) value in Octave has type
information associated with it. You can use "class" and "typeinfo" to
inquire about the type.

You can type "whos" as the command line as well.

Ben



reply via email to

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