Dan,
I get better results by leaving out j. from your
solution if m can be a vector of the same length as x.
ins=: 1 : 0
:
(/:(1+m),i.#y){x,y
)
0 4(1 3 ins) 2 3 5 6
2 3 0 5 6 4
0 4(3 1 ins) 2 3 5 6
2 3 4 5 6 0
On Thu, 23 Aug 2007, Dan Baronet wrote:
+ How about using /: as in
+
+ ins=: 1 : 0
+ :
+ (/:(1+j.m),i.#y){x,y
+ )
+
+ remove the 1+ to work in offset mode
+ /D
+
+
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm