Would you like this more? I just modified your sentence a little. j=: 13 :' ;x <@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' j 4 : ' ;x <@((D=:,"1}.)"1#~(C=:=&{:|.)"1)"1 _ y' f=: 13 :';x ([:<(,"1}.)"1#~(=&{:|.)"1)"1 _ y' f [: ; ([: < (,"1 }.)"1 #~ (=&{: |.)"1)"1 _ A j B 0 1 2 0 1 2 0 1 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 A f B 0 1 2 0 1 2 0 1 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 Linda
-----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Aai Sent: Monday, October 15, 2012 12:50 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] stitching matrices Sorry, by far from elegant: ;A <@((,"1}.)"1#~(=&{: |.)"1)"1 _ B 0 1 2 0 1 2 0 1 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 On 15-10-12 16:59, R.E. Boss wrote: > Given > > ['A B' =. 3|L:0<@i."(1)3 5,: 5 4 > +---------+-------+ > |0 1 2 0 1|0 1 2 0| > |2 0 1 2 0|1 2 0 1| > |1 2 0 1 2|2 0 1 2| > | |0 1 2 0| > | |1 2 0 1| > +---------+-------+ > > I want to stitch every row from A with all rows from B where ({:"1 A) equals {."1 B and one of these columns is deleted. > This will give me > > A foo B > 0 1 2 0 1 2 0 1 > 0 1 2 0 1 2 0 1 > 2 0 1 2 0 1 2 0 > 2 0 1 2 0 1 2 0 > 1 2 0 1 2 0 1 2 > > Any elegant solutions? > > > R.E. Boss > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- Met vriendelijke groet, @@i = Arie Groeneveld ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm