Path: news.mathworks.com!not-for-mail
From: "Danny " <dundee.hpaek@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Permutation or combination of numbers
Date: Sun, 24 Jul 2011 00:31:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <j0fp4f$kng$1@newscl01ah.mathworks.com>
Reply-To: "Danny " <dundee.hpaek@gmail.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1311467471 21232 172.30.248.37 (24 Jul 2011 00:31:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 24 Jul 2011 00:31:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2959884
Xref: news.mathworks.com comp.soft-sys.matlab:737306

I'd like to have all the possible combinations of numbers, permutation(?).
If I have a vector A=[1,2,3,4], then the matrix that I want is :

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

Thanks for the attention.
Danny