add tocol.m

NOTE: this function was left out from the previous commit by mistake,
and, contrary to what that commit's message says ("all active tests
pass"), in fact tests/test_ndarray_to_table.m fails without the
function added in this commit.