Brian, I'm probably more likely to remember your definition, but....
A=:i.4 2
f=:%
g=: 13 :'(}:"1 y) f }."1 y'
g A
0
0.666667
0.8
0.857143
j=: 13 :'(0{"1 y) f 1{"1 y'
j A
0 0.666667 0.8 0.857143
g
}:"1 f }."1
j
(0 {"1 ]) f 1 {"1 ]
Since this works, why isn't k like g ?
(0{"1 A) f 1{"1 A
0 0.666667 0.8 0.857143
k=:(0{"1) f 1{"1
|syntax error: scriptd
| k=:( 0{"1)f 1{"1
|[-15] c:\users\owner\j801-user\temp\96.ijs
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Brian Schott
Sent: Thursday, May 01, 2014 8:24 AM
To: Programming forum
Subject: Re: [Jprogramming] Applying a dyad to exusting matrix data
Linda,
The fact that h produces a table is annoying to me sometimes. It turns out
that the problem can be avoided by using { instead of }: and }. as defined
in j next.
j=:0&{"1 f 1&{"1
j A
0 0.666667 0.8 0.857143
On Thu, May 1, 2014 at 5:07 AM, Linda Alvord <[email protected]>wrote:
> ]A=:i.4 2
> 0 1
> 2 3
> 4 5
> 6 7
> f=: %
> g=: [: f/ |:
> g A
> 0 0.666667 0.8 0.857143
>
> The result using g is a list.
>
> h=:}:"1 f }."1
> h A
> 0
> 0.666667
> 0.8
> 0.857143
>
> But the result using h is a table.
>
> Linda
>
> :
>
>
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm