diff --git a/funDef.mat b/funDef.mat index 8b74080..f60d588 100644 Binary files a/funDef.mat and b/funDef.mat differ diff --git a/funDef.txt b/funDef.txt index 4ebb280..118e6e3 100644 --- a/funDef.txt +++ b/funDef.txt @@ -599,7 +599,7 @@ Y@ 1 2 1 2 1 1 1 true true true true if numel(in)==1 all possible permutations out{1} = sortrows(combs); clear combs n x end % Variations are computed like Cartesian power (variations with repetitions), and then results with repetitions are removed -Z@ 1 3 1 2 1 1 1 true true true true c = ischar(in{1}); random permutation \matlab+randperm+ (produces a row vector as output). If $3$ inputs: third input indicates number of permutations, each on a different row. If first input is char it is interpreted as population (not as size) +Z@ 1 3 1 2 1 1 1 true true true true c = ischar(in{1}); random permutation \matlab+randperm+ (produces a row vector as output). If $3$ inputs: third input indicates number of permutations, each on a different row. If first input is char it is interpreted as population (not as size). \sa \matl+Zr+ if c, x = in{1}; in{1} = numel(in{1}); end if numel(in)~=3, out{1} = randperm(in{:}); else [~, p] = sort(rand(in{3},in{1}),2); p = p(:,1:in{2}); out{1} = p; end diff --git a/help.mat b/help.mat index 71ab0cd..0ca9712 100644 Binary files a/help.mat and b/help.mat differ diff --git a/spec/MATL_spec.pdf b/spec/MATL_spec.pdf index 8946e40..2ab5222 100644 Binary files a/spec/MATL_spec.pdf and b/spec/MATL_spec.pdf differ diff --git a/spec/funDefTable/funDefTable.tex b/spec/funDefTable/funDefTable.tex index 7d74483..80d6b5e 100644 --- a/spec/funDefTable/funDefTable.tex +++ b/spec/funDefTable/funDefTable.tex @@ -83,7 +83,7 @@ \matl{Y?} & 0 & 1 & answer why. Sort of \\ \matl{Z?} & 1--6 (3) & 1 & \matlab+sparse+. If $3$ inputs and third input is \matlab+char+, the output is converted to \matlab+char+ \\ \matl{Y@} & 1--2 (1 / 2) & 1 & If $1$ input: \matlab+perms+. If $2$ inputs: variations (without repetition). In either case, the results are sorted \\ -\matl{Z@} & 1--3 (1 / 2) & 1 & \matlab+randperm+ (produces a row vector as output). If $3$ inputs: third input indicates number of permutations, each on a different row. If first input is char it is interpreted as population (not as size) \\ +\matl{Z@} & 1--3 (1 / 2) & 1 & \matlab+randperm+ (produces a row vector as output). If $3$ inputs: third input indicates number of permutations, each on a different row. If first input is char it is interpreted as population (not as size). \sa \matl{Zr} \\ \matl{A} & 1--2 (1 / 2) & 1 & \matlab+all+. \sa \matl{XA} \\ \matl{XA} & 1 & 1 & \matlab+all(..., 1)+. \sa \matl{A} \\ \matl{YA} & 2--3 (2 / 3) & 1 & (i) \matlab+dec2base+. (ii) If second input has more than one element: it defines the symbols, which can be characters or numbers. The number of symbols defines the base, which can exceed $36$. (iii) If second input is a negative number \matlab+-n+: it is interpreted as symbols \matlab+0:n-1+ (case ii). (i, ii) Base \matl{0} is interpreted as \matl{10}, \matl{1} as \matl{16}, \matl{F} as \matl{0:9}, \matl{T} as \matl{0:15}. \sa \matl{ZA}, \matl{Za} \\