b=.1 0 1 0 0
  x0=.?5$33
  x1=.?5$33
  x0
18 13 28 11 4
  x1
20 28 9 9 9
  b#x0
18 28
  (-.b)#x1
28 9 9


2006/10/24, Leigh J. Halliwell <[EMAIL PROTECTED]>:

Thank you, Roger and Cliff.  On my first question I was indeed thinking of
the monadic amend.  And Cliff's use of it for my second question is nice,
too.  But I'd still like to know how to make the identity/left operator
work
one-to one, as per my second question:

"2) X0 and X1 are numeric vectors, and B is a Boolean vector.  They all
have
the same length.  I'd like to select from X0 where B is 0, and from X1
where
B is 1.  I try the expression: X1 [^:B X0.  But the adverb ^:B wants to
get
two-dimensional, i.e., to apply each B to every pair of X1 and X2.  How
can
I make J to apply the adverb one-to-one with the arguments?"

Sincerely,
Leigh


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




--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
         /|_      .-----------------------------------.
        ,'  .\  /  | Með léttri lund verður        |
    ,--'    _,'   | Dagurinn í dag                     |
   /       /       | Enn betri en gærdagurinn  |
  (   -.  |        `-----------------------------------'
  |     ) |        (\_ _/)
 (`-.  '--.)       (='.'=)
  `. )----'        (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to