Skip to content

Commit 620763e

Browse files
committed
In Za the third input can now also be a logical scalar
and then it's interpreted like the second input
1 parent 051db03 commit 620763e

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

doc/MATL_spec.pdf

9 Bytes
Binary file not shown.

funDef.mat

0 Bytes
Binary file not shown.

funDef.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,14 @@ Ya 2 4 2 3 1 1 1 true true true true if ~any(imag(in{2})) && ~any(in{2}<0) pad
954954
end
955955
out{1} = in{1};
956956
end
957-
Za 3 4 3 4 1 1 1 true true true true if ~iscell(in{1}), in{1} = mat2cell(in{1}, ones(1,size(in{1},1)), size(in{1},2)); else in{1} = in{1}(:); end Convert numbers between bases Converts the number represented by input 1 from the base specified by input 2 to that of input 3. Each base can be a number or a vector. In the first case the alphabet is from 0 to that number minus 1. If the second input equals \matl+T+ or \matl+F+, it is respectively interpreted as \matlab+' ':'~'+ (all printable ASCII chars) or \matlab+[' ':'&' '(':'~']+ (all printable ASCII chars except single quote). Non-valid digits in the first input are discarded. An optional fourth input indicates number of digits of the result. First input can be a matrix or a cell array; and then the result is a matrix in which each row corresponds to a row of the input matrix, or to a cell of the input cell array in linear order. \sa \matl+YA+, \matl+ZA+
957+
Za 3 4 3 4 1 1 1 true true true true if ~iscell(in{1}), in{1} = mat2cell(in{1}, ones(1,size(in{1},1)), size(in{1},2)); else in{1} = in{1}(:); end Convert numbers between bases Converts the number represented by input 1 from the base specified by input 2 to that of input 3. Each base can be a number or a vector. In the first case the alphabet is from 0 to that number minus 1. If the second or third input equals \matl+T+ or \matl+F+, it is respectively interpreted as \matlab+' ':'~'+ (all printable ASCII chars) or \matlab+[' ':'&' '(':'~']+ (all printable ASCII chars except single quote). Non-valid digits in the first input are discarded. An optional fourth input indicates number of digits of the result. First input can be a matrix or a cell array; and then the result is a matrix in which each row corresponds to a row of the input matrix, or to a cell of the input cell array in linear order. \sa \matl+YA+, \matl+ZA+
958958
if ~iscell(in{1}), in{1} = mat2cell(in{1}, ones(1,size(in{1},1)), size(in{1},2)); else in{1} = in{1}(:); end
959959
if islogical(in{2}) && isscalar(in{2})
960960
if in{2}, in{2} = ' ':'~'; else in{2} = [' ':'&' '(':'~']; end
961961
end
962+
if islogical(in{3}) && isscalar(in{3})
963+
if in{3}, in{3} = ' ':'~'; else in{3} = [' ':'&' '(':'~']; end
964+
end
962965
if numel(in{2})>1, ax = in{2}; bx=numel(ax); else bx = in{2}; ax = 0:bx-1; end
963966
if numel(in{3})>1, az = in{3}; bz=numel(az); else bz = in{3}; az = 0:bz-1; end
964967
Z = cell(size(in{1}));

help.mat

-23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)