How to leave out selected elements from a vector?
Ben Abbott
bpabbott at mac.com
Fri Jul 18 17:10:19 CDT 2008
On Jul 18, 2008, at 5:28 PM, Jaroslav Hajek wrote:
> On Fri, Jul 18, 2008 at 11:17 PM, Shaun Jackman <sjackman at bcgsc.ca>
> wrote:
>> Jaroslav Hajek wrote:
>>>
>>> On Fri, Jul 18, 2008 at 7:07 PM, Shaun Jackman <sjackman at bcgsc.ca>
>>> 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
More information about the Help-octave
mailing list