Skip to content

Commit ee8bd43

Browse files
committed
Alternative input/output specification for u
1 parent 65f0a1e commit ee8bd43

File tree

11 files changed

+8
-60
lines changed

11 files changed

+8
-60
lines changed

funDef.mat

5 Bytes
Binary file not shown.

funDef.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ Zt 3 3 3 1 1 1 true true true true if ischar(in{1}) || iscell(in{1}) replace s
18491849
if islogical(in{3}), y = logical(y); end
18501850
out{1} = y; clear t p r m n mem
18511851
end
1852-
u 1 4 1 1 4 1 true true true true str = {'stable' 'sorted' 'last' 'first' 'rows'}; unique \matlab+unique+, with \matlab+'stable'+ option by default. It includes a fourth output with the count for each unique element. It also allows cell array input with numeric content, or mixed char/numeric content. In this case it only works with a single output, either in sorted or stable mode. This function allows flag strings in second and subsequent inputs to be replaced by numbers, as follows: 1: \matlab+'stable'+, 2: \matlab+'sorted'+, 3: \matlab+'last'+, 4: \matlab+'first'+, 5: \matlab+'rows'+. \sa \matl+Xu+
1852+
u 1 4 1 1 4 1 [true false false true] true true true true str = {'stable' 'sorted' 'last' 'first' 'rows'}; unique \matlab+unique+, with \matlab+'stable'+ option by default. It includes a fourth output with the count for each unique element. It also allows cell array input with numeric content, or mixed char/numeric content. In this case it only works with a single output, either in sorted or stable mode. This function allows flag strings in second and subsequent inputs to be replaced by numbers, as follows: 1: \matlab+'stable'+, 2: \matlab+'sorted'+, 3: \matlab+'last'+, 4: \matlab+'first'+, 5: \matlab+'rows'+. \sa \matl+Xu+
18531853
for k = 2:numel(in), if isnumeric(in{k}), in(k) = str(in{k}); end; end; clear str
18541854
if numel(in)==1 || (numel(in)==2 && strcmp(in{2}, 'rows')), in{end+1} = 'stable'; end
18551855
if iscell(in{1}) && ~all(cellfun(@ischar, in{1}))

genHelp.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,11 @@
246246
% necessary (that depends on the function. For `find` it would be necessary, because its first output changes
247247
% depending on whether there's a second output or not). So I don't specify
248248
case {'[false true false]' '[false,true,false]' '[false, true, false]'}
249-
altOutStr = '2nd'; % It should be specified "2nd of 3"
249+
altOutStr = '2nd'; % It should be specified '2nd of 3'
250250
case {'[false false true]' '[false,false,true]' '[false, false, true]'}
251251
altOutStr = '3rd';
252+
case {'[true false false true]' '[true,false,false,true]' '[true, false, false, true]'}
253+
altOutStr = '1st and 4th';
252254
case {'ndims(in{1})'}
253255
altOutStr = 'number of dimensions of first input';
254256
otherwise

help.mat

11 Bytes
Binary file not shown.

spec/MATL_spec.aux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
\gdef \LT@i {\LT@entry
110110
{1}{23.31676pt}\LT@entry
111111
{6}{58.27696pt}\LT@entry
112-
{4}{68.87401pt}\LT@entry
112+
{13}{100.5081pt}\LT@entry
113113
{1}{273.29929pt}}
114114
\gdef \LT@ii {\LT@entry
115115
{1}{23.69952pt}\LT@entry

spec/MATL_spec.pdf

44 Bytes
Binary file not shown.

spec/funDefTable/funDefTable.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
\matl{Zs} & 1--4 (1 / 2) & 1 & (i) \matlab+std+. (ii) With $2$ inputs \matlab+x+, \matlab+k+ and \matlab+k+ equal to $2$ or $3$, gives \matlab+cov(x, k-2)+. (iii) With $2$ inputs \matlab+x+, \matlab+k+ and \matlab+k+ equal to $4$ or $5$, gives \matlab+skewness(x(:), k-4)+. (iv) With $2$ inputs \matlab+x+, \matlab+k+ and \matlab+k+ equal to $6$ or $7$, gives \matlab+kurtosis(x(:), k-6)+ \\
241241
\matl{t} & 0-- (1) & 0 & duplicate elements in stack. The duplicated elements are those specified as inputs. \sa \matl{y} \\
242242
\matl{Zt} & 3 & 1 & (i) If first input is char or a cell array: \matlab+strrep+. Numerical second and third inputs are converted to char. If the first input is char it is linearized into a row vector. (ii) The first input can be a numerical or logical array (not a cell array of numeric or logical arrays). In this case the other inputs can be char, numeric or logical (not cell); each input array is linearized; result is a row vector; and result has the type of the third input, even if no substitutions have been actually done \\
243-
\matl{u} & 1--4 (1) & 1--4 (1) & \matlab+unique+, with \matlab+'stable'+ option by default. It includes a fourth output with the count for each unique element. It also allows cell array input with numeric content, or mixed char/numeric content. In this case it only works with a single output, either in sorted or stable mode. This function allows flag strings in second and subsequent inputs to be replaced by numbers, as follows: 1: \matlab+'stable'+, 2: \matlab+'sorted'+, 3: \matlab+'last'+, 4: \matlab+'first'+, 5: \matlab+'rows'+. \sa \matl{Xu} \\
243+
\matl{u} & 1--4 (1) & 1--4 (1 / 1st and 4th) & \matlab+unique+, with \matlab+'stable'+ option by default. It includes a fourth output with the count for each unique element. It also allows cell array input with numeric content, or mixed char/numeric content. In this case it only works with a single output, either in sorted or stable mode. This function allows flag strings in second and subsequent inputs to be replaced by numbers, as follows: 1: \matlab+'stable'+, 2: \matlab+'sorted'+, 3: \matlab+'last'+, 4: \matlab+'first'+, 5: \matlab+'rows'+. \sa \matl{Xu} \\
244244
\matl{Xu} & 1--3 (1) & 1--4 (1) & \matlab+unique(..., 'rows', ...)+, with \matlab+'stable'+ option by default. It includes a fourth output with the count for each unique row. This function allows flag strings in second and subsequent inputs to be replaced by numbers, as follows: 1: \matlab+'stable'+, 2: \matlab+'sorted'+, 3: \matlab+'last'+, 4: \matlab+'first'+. \sa \matl{u} \\
245245
\matl{Zu} & 2 & 1 & \matlab+strjust+. Strings in second input can be replaced by numbers, as follows: 1: \matlab+'right'+, 2: \matlab+'left'+, 3: \matlab+'center'+ \\
246246
\matl{v} & 0-- ($^\ddagger$ / 2) & 1 & \matlab+vertcat+. If inputs are matrices with non-matching sizes they are linearized \\

spec/latex_tools/MATL_spec.aux

Lines changed: 0 additions & 56 deletions
This file was deleted.

spec/latex_tools/MATL_spec.out

Whitespace-only changes.

spec/latex_tools/MATL_spec.pdf

-117 KB
Binary file not shown.

0 commit comments

Comments
 (0)