Is this closer to what you are looking for Piet?
[n=: i. 3 3 3
0 1 2
3 4 5
6 7 8
9 10 11
12 13 14
15 16 17
18 19 20
21 22 23
24 25 26
slice=: ;@{"]:
0 (2 slice) n
0 1 2
9 10 11
18 19 20
1 (2 slice) n
3 4 5
12 13 14
21 22 23
2 (2 slice) n
6 7 8
15 16 17
24 25 26
0 (1 slice) n
0
3
6
9
12
15
18
21
24
1 (1 slice) n
1
4
7
10
13
16
19
22
25
2 (1 slice) n
2
5
8
11
14
17
20
23
26
0 (0 slice) n
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Cheers, bob
> On Sep 6, 2023, at 15:10, Piet de Jong <[email protected]> wrote:
>
> Here is my “wish"
>
> A dyadic (tacit) verb such that x v y gives all the slices of y along
> dimension x, where x is integer. That is to say
>
> i{ x v y
>
> is slice i of the array y along dimension x.
>
> Thanks for all your help!
>
>> On 7 Sep 2023, at 08:04, 'robert therriault' via Programming
>> <[email protected]> wrote:
>>
>> Or something like this?
>>
>> [n =. i. 2 2 2
>> 0 1
>> 2 3
>>
>> 4 5
>> 6 7
>> ,./ n
>> 0 1 4 5
>> 2 3 6 7
>> ($ $ (,@,./)) n
>> 0 1
>> 4 5
>>
>> 2 3
>> 6 7
>>
>> Cheers, bob
>>
>>
>>> On Sep 6, 2023, at 14:49, 'robert therriault' via Programming
>>> <[email protected]> wrote:
>>>
>>> Hi Piet,
>>>
>>> Maybe show us what you would want to do with higher dimensions? Or a less
>>> symmetric 2 dimensional shape?
>>>
>>> For shape 2 2, I would use the even simpler
>>>
>>> |: m
>>> 0 2
>>> 1 3
>>>
>>> Hope this helps.
>>>
>>> Cheers, bob
>>>
>>>> On Sep 6, 2023, at 14:26, Brian Schott <[email protected]> wrote:
>>>>
>>>> ,./0 1 {"1 m
>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm