[Jprogramming] rank trouble
Devon McCormick
devonmcc at gmail.com
Sat Jun 2 00:50:43 HKT 2012
You could also do this:
e ([:~.]-.]-.[) pi
3 1 2
pi ([:~.]-.]-.[) e
2 1 3
Without the "nub" gives an arguably more correct answer:
pi (]-.]-.[) e
2 1 2 1 3
e (]-.]-.[) pi
3 1 1 2
/:~"1 e,:pi
1 1 2 2 3 7 8 8 8
1 1 2 3 4 5 5 6 9
On Thu, May 31, 2012 at 10:48 AM, Graham Parkhouse
<graham.parkhouse at ntlworld.com> wrote:
> Can anyone help me to understand where I am going wrong?
>
> e=: 2 7 1 8 2 8 1 8 3
> pi=: 3 1 4 1 5 9 2 6 5
> isecn=: ([: /:~ [: ~. e. # [)"1 NB. Intersection of the two sets
> e isecn pi
> 1 2 3
> pi isecn e
> 1 2 3
> isecn/ e,:pi
> 1 2 3
> isecn/"1 e,.pi
>
>
>
>
>
>
>
>
> This last sentence give me 9 blank lines. I expected and wanted 1 2 3. Is my
> view of rank and frames too simplistic?
>
> Regards
>
> Graham
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
More information about the Programming
mailing list