Sorry about the +, it slipped away too fast.
nozzzz=: 13 :'(0{y)#"1(1{$y)#y'
nozzzz i.2 3
1 2 2
1 2 2
1 2 2
4 5 5
4 5 5
4 5 5
z=: 13 :'(1{y)#"1(0{$y)#y'
z i.2 3
0 0 0 1 1 1 1 2 2 2 2 2
0 0 0 1 1 1 1 2 2 2 2 2
3 3 3 4 4 4 4 5 5 5 5 5
3 3 3 4 4 4 4 5 5 5 5 5
z
(1 { ]) #"1 ] #~ 0 { $
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of 'Pascal
Jasmin' via Programming
Sent: Friday, July 18, 2014 12:01 AM
To: [email protected]
Subject: Re: [Jprogramming] a zoom function (doubling points accross rows
and columns)
following the train theme, to do scaling (zoom/copy by different amounts on
each axis)
X0 =: 0 {:: [
X1 =: 1 {:: [
scale =: (X0 # X1 #"_1 ]) f.
scale
(0 {:: [) # (1 {:: [) #"_1 ]
2 3 scale i.2 3
0 0 0 1 1 1 2 2 2
0 0 0 1 1 1 2 2 2
3 3 3 4 4 4 5 5 5
3 3 3 4 4 4 5 5 5
----- Original Message -----
From: Cliff Reiter <[email protected]>
To: [email protected]
Cc:
Sent: Thursday, July 17, 2014 3:27:00 PM
Subject: Re: [Jprogramming] a zoom function (doubling points accross rows
and columns)
Nice. In FVJ3 I use
spix=:[ # #"_1 NB. super pixel
The _1 means this also works for h by w by 3 arrays of RGB triples in
addition to matrices.
Best, Cliff
On 7/16/2014 6:32 PM, 'Pascal Jasmin' via Programming wrote:
> spoiling quiz with answer already, neat short fork.
>
> zoom =: [ # #"1
>
>
> for every cell in original, a 2x2 copy of that cell is made.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Clifford A. Reiter
Lafayette College, Easton, PA 18042
http://webbox.lafayette.edu/~reiterc/
----------------------------------------------------------------------
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