Skip to content

Commit

Permalink
<, > now compare real parts
Browse files Browse the repository at this point in the history
This was the implicit behaviour in MATLAB, but not in Octave
  • Loading branch information
lmendo committed Oct 29, 2019
1 parent 840770e commit dfc8906
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
Binary file modified funDef.mat
Binary file not shown.
6 changes: 4 additions & 2 deletions funDef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ Z: 2 4 3 1 1 1 true true true true if ischar(in{1}), in{1} = double(in{1}); en
X; 1 1 1 1 1 1 true true true true out{1} = acos(in{1}); inverse cosine (radians) \matlab+acos+
Y; 1 1 1 1 1 1 true true true true out{1} = asin(in{1}); inverse sine (radians) \matlab+asin+
Z; 2 2 2 1 1 1 true true true true out{1} = bsxfun(@atan2, in{1}, in{2}); four quadrant inverse tangent (radians; element-wise, singleton expansion) \matlab+atan2+, element-wise with singleton expansion
< 1 2 2 1 1 1 1 true true true true if numel(in)==1, in{2} = in{1}.'; end is less than? (element-wise, singleton expansion) \matlab+<+ (\matlab+lt+), element-wise with singleton expansion. If $1$ input: a second input is used given by the first transposed
< 1 2 2 1 1 1 1 true true true true if numel(in)==1, in{2} = in{1}.'; end is less than? (element-wise, singleton expansion) \matlab+<+ (\matlab+lt+), element-wise with singleton expansion. For complex values, the real parts are compared. If $1$ input: a second input is used given by the first transposed
for k = 1:2, if ~isreal(in{k}), in{k} = real(in{k}); end; end; clear k
out{1} = bsxfun(@lt, in{1}, in{2});
X< 1 3 1 1 2 1 [false true] true true true true if numel(in)==2, out{1} = bsxfun(@min, in{1}, in{2}); minimum \matlab+min+. If $2$ inputs: element-wise with singleton expansion. With more than $2$ inputs, the second is replaced by \matl+[]+. This function does not support flags \matlab+'omitnan'+ or \matlab+'includenan'+. Output is \matlab+char+ if there is $1$ input and it is \matlab+char+, or if there are $2$ inputs and both are \matlab+char+, or if there are $3$ inputs, second is empty and third is \matlab+char+. \sa \matl+X>+, \matl+Xl+
elseif numel(in)==1, [out{:}] = min(in{:});
Expand All @@ -561,7 +562,8 @@ Z<
X= 0 inf 2 numel(STACK) 1 1 1 true true true true if numel(in)>=2, out{1} = isequal(in{:}); else out{1} = true; end true if arrays are numerically equal \matlab+isequal+. Works for any number of inputs
Y= 2 2 2 1 1 1 true true true true if isnumeric(in{1}), in{1} = char(in{1}); end; if isnumeric(in{2}), in{2} = char(in{2}); end; out{1} = strcmp(in{:}); compare strings \matlab+strcmp+. If first or second inputs are numeric they are converted to char
Z=
> 1 2 2 1 1 1 1 true true true true if numel(in)==1, in{2} = in{1}.'; end is greater than? (element-wise, singleton expansion) \matlab+>+ (\matlab+gt+), element-wise with singleton expansion. If $1$ input: a second input is used given by the first transposed
> 1 2 2 1 1 1 1 true true true true if numel(in)==1, in{2} = in{1}.'; end is greater than? (element-wise, singleton expansion) \matlab+>+ (\matlab+gt+), element-wise with singleton expansion. For complex values, the real parts are compared. If $1$ input: a second input is used given by the first transposed
for k = 1:2, if ~isreal(in{k}), in{k} = real(in{k}); end; end; clear k
out{1} = bsxfun(@gt, in{1}, in{2});
X> 1 3 1 1 2 1 [false true] true true true true if numel(in)==2, out{1} = bsxfun(@max, in{1}, in{2}); maximum \matlab+max+. If $2$ inputs: element-wise with singleton expansion. With more than $2$ inputs, the second is replaced by \matl+[]+. This function does not support flags \matlab+'omitnan'+ or \matlab+'includenan'+. Output is \matlab+char+ if there is $1$ input and it is \matlab+char+, or if there are $2$ inputs and both are \matlab+char+, or if there are $3$ inputs, second is empty and third is \matlab+char+. \sa \matl+X<+, \matl+Xl+
elseif numel(in)==1, [out{:}] = max(in{:});
Expand Down
Binary file modified help.mat
Binary file not shown.
Binary file modified spec/MATL_spec.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions spec/funDefTable/funDefTable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@
\matl{X;} & 1 & 1 & \matlab+acos+ \\
\matl{Y;} & 1 & 1 & \matlab+asin+ \\
\matl{Z;} & 2 & 1 & \matlab+atan2+, element-wise with singleton expansion \\
\matl{<} & 1--2 (2 / 1) & 1 & \matlab+<+ (\matlab+lt+), element-wise with singleton expansion. If $1$ input: a second input is used given by the first transposed \\
\matl{<} & 1--2 (2 / 1) & 1 & \matlab+<+ (\matlab+lt+), element-wise with singleton expansion. For complex values, the real parts are compared. If $1$ input: a second input is used given by the first transposed \\
\matl{X<} & 1--3 (1) & 1--2 (1 / 2nd) & \matlab+min+. If $2$ inputs: element-wise with singleton expansion. With more than $2$ inputs, the second is replaced by \matl{[]}. This function does not support flags \matlab+'omitnan'+ or \matlab+'includenan'+. Output is \matlab+char+ if there is $1$ input and it is \matlab+char+, or if there are $2$ inputs and both are \matlab+char+, or if there are $3$ inputs, second is empty and third is \matlab+char+. \sa \matl{X>}, \matl{Xl} \\
\matl{Y<} & 1--3 (1 / 2) & 1 & \matlab+cummin+. Output is \matlab+char+ if first input is. \sa \matl{Y>} \\
\matl{=} & 1--2 (2 / 1) & 1 & \matlab+==+ (\matlab+eq+), element-wise with singleton expansion. If $1$ input: a second input is used given by the first transposed \\
\matl{X=} & 0-- (2 / $^\ddagger$) & 1 & \matlab+isequal+. Works for any number of inputs \\
\matl{Y=} & 2 & 1 & \matlab+strcmp+. If first or second inputs are numeric they are converted to char \\
\matl{>} & 1--2 (2 / 1) & 1 & \matlab+>+ (\matlab+gt+), element-wise with singleton expansion. If $1$ input: a second input is used given by the first transposed \\
\matl{>} & 1--2 (2 / 1) & 1 & \matlab+>+ (\matlab+gt+), element-wise with singleton expansion. For complex values, the real parts are compared. If $1$ input: a second input is used given by the first transposed \\
\matl{X>} & 1--3 (1) & 1--2 (1 / 2nd) & \matlab+max+. If $2$ inputs: element-wise with singleton expansion. With more than $2$ inputs, the second is replaced by \matl{[]}. This function does not support flags \matlab+'omitnan'+ or \matlab+'includenan'+. Output is \matlab+char+ if there is $1$ input and it is \matlab+char+, or if there are $2$ inputs and both are \matlab+char+, or if there are $3$ inputs, second is empty and third is \matlab+char+. \sa \matl{X<}, \matl{Xl} \\
\matl{Y>} & 1--3 (1 / 2) & 1 & \matlab+cummax+. Output is \matlab+char+ if first input is. \sa \matl{Y<} \\
\matl{Y?} & 0 & 1 & answer why. Sort of \\
Expand Down

0 comments on commit dfc8906

Please sign in to comment.