Hi Don,

I think that copy (#) combined with increment (>:) may be able to do the trick.

   1 1 0 0 1#i.5 NB.index 0
0 1 4
   1 1 0 0 1>:@#i.5 NB.index 1
1 2 5
   
Although reading through your journey to get to this point I wonder if Nub (~.) 
would do the trick.

   arr
ab 
cd 
yyy
jcd
ab 
cd 
yyy
jcd
ab 
cd 
   +./"1 'cd' E."1 arr
0 1 0 1 0 1 0 1 0 1
   ( i.#arr) * +./"1 'cd' E."1 arr 
0 1 0 3 0 5 0 7 0 9
   ~. ( i.#arr) * +./"1 'cd' E."1 arr 
0 1 3 5 7 9

Cheers, bob

On Aug 30, 2014, at 4:30 PM, Don Kelly <d...@shaw.ca> wrote:

> 1 1 0 0 1/⍳5

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to