MATLAB: Math Question_ Combination

mathematicsMATLABmatrix

Hi,
Let say i have 10 location. I wana test 3 location at a time.
i think there are 10C3=120 combination.(assuming order of the location is not important).
My question is how do i list all the combination in an array?
For example [1 2 3,1 2 4, 1 2 5 ,. . . . . till the 120th]

Best Answer

nchoosek(1:10,3)