Publisher review:PERMPOS - all possible permutations of M values in N positions PERMPOS - all possible permutations of M values in N positions B = PERMPOS(M,N) where M and N are non-negative integers produces a logical (N!/M!(N-M)!)-by-N matrix in which each row contains a unique permation of M trues and (N-M) falses. Note that each column will hence contain (N-1) trues. B = PERMPOS(V,N) where V is a vector of length M produces a matrix where each row a contains the values of V in preserved order, but uniquely permuted at the N columns. The remaining positions are zero.Examples:permpos(2,4) % ->% 1 1 0 0% 1 0 1 0% 1 0 0 1% 0 1 1 0% 0 1 0 1% 0 0 1 1permpos([-4 9 3],4) % >% -4 9 3 0% -4 9 0 3% -4 0 9 3% 0 -4 9 3See also NCHOOSEK, PERMS, RANDPERM, TRUE, FALSE and COMBN, ALLCOMB, BALLATSQ, NONES (Matlab File Exchange) Requirements: ยท MATLAB Release: R13
PERMPOS 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