ch2marray function

Converts capture-histories to an m-array