It is exactly correct that this function with call structure
C1 = onecomb(N,K,M)
returns the same result as
AC = nchoosek(N,K);
C2 = AC(M,:)
The advantage of this function is that the intermediate array AC is not computed by ONECOMB. The array AC can be immensely large for large N and K approx N/2, and is a waste to compute if one only requires a small number of combinations from the total.
Additionally, if one requires many combinations, my testing (not included here but simple to duplicate) showed that the time to compute all the combinations using NCHOOSEK was approximately the same as computing all the combinations one-at-a-time using ONECOMB.