P.S. if you want to avoid boxing (for speed):
($old)$(,new) (($old) #. ($new) #: i.$,new)} ,old
1 1 1 0
1 1 1 0
1 1 1 0
0 0 0 0
($old)$(,new) (($old) #. 0 1+"1 ($new) #: i.$,new)} ,old
0 1 1 1
0 1 1 1
0 1 1 1
0 0 0 0
Thanks,
--
Raul
On Tue, Oct 21, 2014 at 1:24 PM, Raul Miller wrote:
>
new=:3 3$1
old=:4 4$0
new (($new) <@#: i.$new)} old
1 1 1 0
1 1 1 0
1 1 1 0
0 0 0 0
new (($new) <@(0 1&+)@#: i.$new)} old
0 1 1 1
0 1 1 1
0 1 1 1
0 0 0 0
You can replace the 0 1 with any valid coordinate for the upper left corner.
You can either make this an explicit definition, or
14 15
(0 0 toV 2 2) (1 advswap '}') i.4 4
1 1 1 3
1 1 1 7
1 1 1 11
12 13 14 15
From: Sebastian
To: "programm...@jsoftware.com"
Sent: Tuesday, October 21, 2014 10:04 AM
Subject: [Jprogramming] Insert a 2 dimensional a
maybe not straightforward)
Ben
From: programming-boun...@forums.jsoftware.com
[programming-boun...@forums.jsoftware.com] on behalf of Sebastian
[seb_fo...@arcor.de]
Sent: Tuesday, October 21, 2014 16:04
To: programm...@jsoftware.com
Subject: [Jprogramming] Ins
Hello,
I have a question similar to the question I had a few weeks before. The
question was how replace single values from a matrix
(http://jsoftware.com/pipermail/programming/2014-September/039225.html).
Now I would like to replace a matrix with at least 2 dimensions with
values from a 2 dim