Dear all:

I would like to know subtotals in the specified intervals.

for example,
specified intervals:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
 [0,0.1)[0.1,0.2)...[0.9,1]

When we know the the number of counts in each interval, the following code would be helpful.

subtotal=: 4 : 0
u-_1}.0,u=.(<:+/\y){+/\x
)

x=:>i.10
y=:2 3 2 3 NB. count for each interval
   x
1 2 3 4 5 6 7 8 9 10
   y
2 3 2 3
   x subtotal y
3 12 13 27

Best regards.

Toshinari Kamakura


+++++++++++++++++++++++++++++
    Toshinari Kamakura

    Chuo University
    1-13-27 Kasuga
    Bunkyo-ku
    Tokyo 112-8551, Japan
++++++++++++++++++++++++++++++



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

Reply via email to