Another approach:

   c=: 20 40
   p=: 0.9 0.8 0.75
   q =: 15 35 50       NB. three alternatives
   diff =: (2-~/\])"1  NB. row first difference
   p+/ . *"1 diff q<./0,c,_
13.5 30 41.5

(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to