Publisher review:COMBN - All combinations of N elements taken from the vector V. COMBN - all combinations of elementsM = COMBN(V,N) returns all combinations of N elements of the elements in vector V. M has the size (length(V).^N)-by-N.[M,I] = COMBN(V,N) also returns the index matrix I so that M = V(I).V can be an array of numbers, cells or strings.Example:M = COMBN([0 1],3) returns the 8-by-3 matrix:0 0 00 0 10 1 00 1 1...1 1 1All elements in V are regarded as unique, so M = COMBN([2 2],3) returns a 8-by-3 matrix with all elements equal to 2.NB Matrix sizes increases exponentially at rate (n^N)*N.COMBN is very fast using a single matrix multiplication, without any explicit for-loops. See also PERMS, NCHOOSEK and ALLCOMB, PERMPOS here on the FEX Requirements: ยท MATLAB Release: R13
COMBN is a Matlab script for Mathematics scripts design by Josh.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Operating system:Windows / Linux / Mac OS / BSD / Solaris