david alis wrote:
> data=: 5000 1000$'+4.31:A+-:H+-:H+4.30:A+4.32:A+4.25:A+4.25'
> cut =: 4&{.@(<;._1)@(':'&,);._1@('+'&,)
> sm =: (2;sc;pp)&;:  NB. 2 means return array of offets and indexes
...

Perhaps this is useful?

sm2=:(2;(2 2 2$1 1 1 1 1 0 1 2);a.e.'+:')&;:
cutsm=: 4{."2 0:>. 1 _1+"1 (_1 +/\@(|.!.0) #;.1) + sm2;.1

   'cut"1 data' %&(6!:2) 'cutsm"1 data' 
3.60396

-- 
Raul

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

Reply via email to