Toshinari Kamakura wrote:
>I would like to know subtotals in the specified intervals.
I believe this will work:
sbt =: I.&|. +//. ]
Example:
] Y =: 20 (?.%]) 100
0.46 0.99 0.23 0.62 0.42 0.44 0.12 0.05 0.68 0.63 0.76 0.84 0.53 0.83
0.69 0.97 0.74 0.82 0.1 0.79
X =: 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 NB. Original
intervals
X sbt Y
1.71 1.82 1.03 0.52 2.78 0.05 0.53 2.45 0.82
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm