Skip to content

Commit 68dcbb8

Browse files
committed
Zu now requires two inputs. Strings in second input can be replaced by numbers
1 parent 5ab061c commit 68dcbb8

File tree

5 files changed

+4
-2
lines changed

5 files changed

+4
-2
lines changed

funDef.mat

87 Bytes
Binary file not shown.

funDef.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,9 @@ Xu 1 3 1 1 4 1 true true true true str = {'stable' 'sorted' 'last' 'first'}; u
16211621
out{4} = count; clear id count
16221622
end
16231623
Yu
1624-
Zu 1 2 1 1 1 1 true true true true out{1} = strjust(in{:}); justify character array \matlab+strjust+
1624+
Zu 2 2 2 1 1 1 true true true true str = {'right' 'left' 'center'}; justify character array \matlab+strjust+. Strings in second input to be replaced by numbers, as follows: 1: \matlab+'right'+, 2: \matlab+'left'+, 3: \matlab+'center'+
1625+
if isnumeric(in{2}), in(2) = str(in{2}); end; clear str
1626+
out{1} = strjust(in{:});
16251627
v 0 inf numel(STACK) 2 1 1 1 true true true true if any(diff(nonzeros(cellfun(@(x) size(x,2), in)))) vertical concatenation \matlab+vertcat+. If inputs are matrices with non-matching sizes they are linearized
16261628
in = cellfun(@(x) reshape(x,[],1), in, 'uniformoutput', false);
16271629
end

help.mat

58 Bytes
Binary file not shown.

spec/MATL_spec.pdf

83 Bytes
Binary file not shown.

spec/funDefTable/funDefTable.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
\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. (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 \\
239239
\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} \\
240240
\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} \\
241-
\matl{Zu} & 1--2 (1) & 1 & \matlab+strjust+ \\
241+
\matl{Zu} & 2 & 1 & \matlab+strjust+. Strings in second input to be replaced by numbers, as follows: 1: \matlab+'right'+, 2: \matlab+'left'+, 3: \matlab+'center'+ \\
242242
\matl{v} & 0-- ($^\ddagger$ / 2) & 1 & \matlab+vertcat+. If inputs are matrices with non-matching sizes they are linearized \\
243243
\matl{Yv} & 1--2 (1) & 1--3 (1 / 2nd) & (i) If input is numeric: with $1$ or $2$ outputs: \matlab+eig+. With $3$ outputs: \matlab+svd+. (ii) If input is a string or cell array of strings: \matlab+strtrim+. For string or char array input, char $0$ also counts as whitespace \\
244244
\matl{Zv} & 1--2 (1 / 2) & 1 & (i) For one numeric input \matlab+n+: symmetric range. For nonnegative \matlab+n+ it rounds down and then gives \matlab+[1:n n-1:-1:1]+; for negative \matlab+n+ it removes sign, rounds down and gives \matlab+[n:-1:1 2:n]+. (ii) For two inputs: applies symmetric range indexing to the first input along the dimension given by the second input, without repeating the last entry. If the second input is negative the last entry is repeated. (iii) For one string or cell array input: \matlab+deblank+ \\

0 commit comments

Comments
 (0)