Path: news.mathworks.com!not-for-mail
From: "Xiaoyu " <xc1u09@soton.ac.uk>
Newsgroups: comp.soft-sys.matlab
Subject: the output of 'combnk' is in random order ???
Date: Fri, 18 Jan 2013 19:00:09 +0000 (UTC)
Organization: Univ of Southampton
Lines: 36
Message-ID: <kdc63p$n7a$1@newscl01ah.mathworks.com>
Reply-To: "Xiaoyu " <xc1u09@soton.ac.uk>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1358535609 23786 172.30.248.48 (18 Jan 2013 19:00:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Jan 2013 19:00:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2800930
Xref: news.mathworks.com comp.soft-sys.matlab:786824

Hi, I just realize that 'combnk' produce output in some kind of random order. Typically, for combnk(1:N,2)', N=2,3,4,...10, the outut is given as:

combnk(1:4,2)'
ans =

     3     2     2     1     1     1
     4     4     3     4     3     2

while 

combnk(1:6,2)'

ans =

  Columns 1 through 10

     1     1     1     1     1     2     2     2     2     3
     2     3     4     5     6     3     4     5     6     4

  Columns 11 through 15

     3     3     4     4     5
     5     6     5     6     6

The question is how can I  get the outputs all  in ascending order, like all in the form of 
 1     1     1     1     1     2     2     2     2     3 ...
 2     3     4     5     6     3     4     5     6     4 ...

Apparently, 'sort' is not useful, and the randomness of  'combnk'  does not mean the output might just be in a revsere order, for example, in combnk(1:25,13)'
the result in the first column is   

     1     2     3     4     5     6     7     8     9    22   23    24    25

but what I would expect is (1,2,3,4,5...13) ,what code can I use to arrange the output of 'combnk' in such order?

Please help!