### Printing n choose k combinations in matlab

I need to create an algorithm in matlab which returns any combination of n subset from the k set. For example I have a set {1,2,3,4,5} and I need any combination of 3 numbers included in this set. So this function should returns: [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4],…