Code covered by the BSD License  

Highlights from
n permute k

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 2.36 KB File ID: #40546
image thumbnail

n permute k

by

 

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
Description

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.

Acknowledgements

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.
Updates
28 Feb 2013

Changed description
Cell example was wrong

Contact us