help-octave
[Top][All Lists]
Advanced

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

Re: prefer_zero_one_indexing dissapeared from 2.0 to 2.1: how can I live


From: Miquel Cabanas
Subject: Re: prefer_zero_one_indexing dissapeared from 2.0 to 2.1: how can I livewithout it?
Date: Fri, 06 Oct 2006 13:49:33 +0200

On Fri, 2006-10-06 at 12:06 +0200, TEJEDA HERNANDEZ, CESAR wrote:
>
> I have a program that uses that feature, and it seems for me that this
> feature of doing a Boolean indexing:
>
>           a = [1, 2, 3, 4]
>
>           a ([0, 1, 1, 1])
>
>      results in the matrix `[ 2, 3, 4 ]'. 
> 

try,

   a = [1 2 3 4];
   b = [0 1 1 1];

then either of

   find (a.*b > 0)

or

   a (find (b == 1))

or

   a (find (b))

will return

   [2 3 4]



Miquel






reply via email to

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