Thanks a lot !
Michael
>I can use a Do[] but this seems clumsy:
>hist={0,0,0, .... };
>Do[
> ind=myindexfunction[data[[i]]]; hist[[ind]]=hist[[ind]]+1,
>{i,1,Length[data]}]
>
You can use Scan on your data:
Scan[hist[[myindexfunction[#]]]++ &, data]
The ++ operator takes the place of the addition and assignment.
Thus you don't need a local variable for the index anymore.
Dave Wagner
Principia Consulting
(303) 786-8371
dbwa...@princon.com
http://www.princon.com/princon