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".  Additionally, I'm not really sure 
how to ensure that the result of each vector multiplication becomes a 
new row in the desired array.

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

but when I tried "automating" that series of multipliers, J apparently 
just doesn't like my syntax above.  (Of course, that still doesn't 
solve the problem of cumulatively building an array from each set of 
results.)  Help would be greatly appreciated.  Many thanks in advance!

Harvey

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

Reply via email to