View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
n permute k

5.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 2.36 KB File ID: #40546 Version: 1.1
image thumbnail

n permute k


Eydrian (view profile)


27 Feb 2013 (Updated )

Based on Matt Fig's npermutek this function returns all possible permutations of most matlab classes

| Watch this File

File Information

Permutation of elements with replacement/repetition. MAT = npermutek(N,K) returns all possible samplings of length K from vector N of type: ordered sample with replacement. MAT has size (numel(N)^K)-by-K, where K must be a scalar. [MAT, IDX] = npermutek(N,K) also returns IDX such that MAT = N(IDX).
  N may be of any numeric class, char, cell, struct, or even obj.


N Permute K inspired this file.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
12 May 2015 Stephen Cobeldick

Finally a combinatorics submission that actually recognizes the difference between combinations and permutations!

28 Feb 2013 1.1

Changed description
Cell example was wrong

Contact us