On Fri, Jan 7, 2011 at 3:34 PM, PackRat <[email protected]> wrote:
> I want to create a table/array where each row is a list/vector of
> constant values multiplied by a changing value (via an implied loop).
> Here are the data:
>
>   ratios=. 0 1r8 1r4 1r3 1r2 2r3 7r8 1   NB. the "constant" data
>   float=. float=. x: ^: _1   NB. from "Learning J"
>   (15 * i.25)   NB. the "changing" data multiplier
>
> and here is what I intuitively was trying to do:
>
>   float ((15 * i.25) * ratios)
>
> but I keep getting a "length error".
...
> Doing the multiplications manually one by one works fine:
>
>   float (15*ratios)
> 0 1.875 3.75 5 7.5 10 13.125 15
>   float (30*ratios)
> 0 3.75 7.5 10 15 20 26.25 30

It sounds like you are looking for
   float ((15 * i.25) */ratios)
?

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to