Hi,

From the dictionary page on # :

The complex left argument a j. b copies a items followed by b fills.

Also from the dictionary, we get that #’s rank is _ 1 _, so we can suppose the 
left argument is a vector. In that case each atom of the left argument must 
match an item of the right (scalars left arguments are extended). So what you’d 
want for your later examples is

1j6 1 1 # 10 11 12

which gives 1 copy of 10, followed by 6 fill items (0), and then preserves 11 
and 12.

Couldn’t really understand what you were trying to do with b and a. Hope this 
helps!

Cheers,
Louis

> On 27 Apr 2019, at 17:01, Brian Schott <[email protected]> wrote:
> 
> I have a list `b =. ,a` where a is defined below. b always contains 6
> (real) atoms, not necessarily the values in the current example a.
> 
> I want to produce b using complex x values in Copy but cannot seem to get
> the correct x to do so.
> 
>   ]a =: 10+i. 2 3
> 10 11 12
> 13 14 15
>   (0,.~0,.0,~0,])a
> 0  0  0  0 0
> 0 10 11 12 0
> 0 13 14 15 0
> 0  0  0  0 0
>   [b =. ,(0,.~0,.0,~0,])a
> 0 0 0 0 0 0 10 11 12 0 0 13 14 15 0 0 0 0 0 0
> 
> Below are my attempts at learning to use complex x in Copy.
> 
>   0j6 # 4
> 0 0 0 0 0 0
>   0j6 1 # 4
> 0 0 0 0 0 0 4
> 
> The above examples seemed to provide me a guideline, but when I try similar
> examples with a list right hand argument, I seem to lose the (leading) 10
> when I don't get a length error.
> 
>   0j6 1 1 1# 10 11 12
> |length error
> |   0j6 1 1 1    #10 11 12
>   0j6 1 1 # 10 11 12
> 0 0 0 0 0 0 11 12
>   0j6 1 1 1 # 10 11 12
> |length error
> |   0j6 1 1 1    #10 11 12
> 
> How do I get the desired result b(and preserve the 10 in the simpler
> examples)?
> 
> -- 
> (B=) <-----my sig
> Brian Schott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to