You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Correction in `gcd` and `lcm`: they weren't working correctly with a
single input
* `conv` automatically converts its first two inputs to `double`
* `Z}` with two inputs splits along the dimension indicated by second
input
* `isempty` function has been removed (can be done easily with `numel`)
* added Octave compatibility with `spiral` function
* extended `image` to include `imagesc`. This is controlled by last
input.
* Functions `bitand`, `bitor`, `bitxor`, `bitget`, `bitset` now
automatically convert `char` first input
to `double`
* Function `bitset` now has 3 inputs by default
Z& 2 3 2 1 1 1 true true if ischar(in{1}), in{1} = double(in{1}); end bit-wise logical 'and' (element-wise, singleton expansion) \matlab+bitand+, element-wise with singleton expansion. If first input is \matlab+char+ it is automatically converted to \matlab+double+
56
+
if max(size(in{1}))==1 || max(size(in{2}))==1 || isequal(size(in{1}), size(in{2}))
Z. 2 3 2 1 1 1 true true out{1} = bitget(in{:}); get bit \matlab+bitget+
165
+
Z. 2 3 2 1 1 1 true true if ischar(in{1}), in{1} = double(in{1}); end get bit \matlab+bitget+. If first input is \matlab+char+ it is automatically converted to \matlab+double+
Y/ 2 2 2 1 1 1 true true out{1} = in{1}/in{2}; right matrix division right matrix division, \matlab+/+ (\matlab+mrdivide+)
@@ -245,7 +247,8 @@ Y: 1 inf 2 1 inf 1 true true switch in{1} Higham test matrices and other matrice
245
247
otherwise
246
248
[out{:}] = gallery(in{:});
247
249
end
248
-
Z: 2 3 2 1 1 1 true true out{1} = bitset(in{:}); set bit \matlab+bitset+
250
+
Z: 2 4 3 1 1 1 true true if ischar(in{1}), in{1} = double(in{1}); end set bit \matlab+bitset+. If first input is \matlab+char+ it is automatically converted to \matlab+double+
YG 2 inf 2 0 0 0 true true if isnumeric(in{end})&&numel(in{end})~=1, imagesc(in{:}); display image \matlab+imagesc+ or \matlab+image+. If last input is a scalar that evaluates to \matlab+true+ / \matlab+false+: \matlab+imagesc+ / \matlab+image+ is respectively called with remaining inputs. If last input is not a scalar: \matlab+imagesc+ is called with all inputs. Afterwards, in all cases, this sets \matlab+axis ij, axis image+ and calls \matlab+drawnow+ to update figure immediately
350
+
elseif in{end}, imagesc(in{1:end-1});
351
+
else image(in{1:end-1}); end
352
+
axis ij, axis image, drawnow
347
353
ZG 1 1 1 0 1 0 true true [out{:}] = colormap(in{:}); if isempty(out), drawnow, end color look-up table \matlab+colormap+. With $0$ outputs, calls \matlab+drawnow+ to update figure immediately
348
354
H 0 0 0 0 inf numel(CB_H) true true out = CB_H(1:nout); paste from clipboard H paste from clipboard H
349
355
XH 0 inf 1 0 0 0 false true CB_H = in; copy to clipboard H copy to clipboard H
Zd 1 2 2 1 3 1 true true if numel(in)==1 && numel(out)==1, x=in{1}(1); for t=in{1}, x=gcd(x,t); end; out{1}=x; greatest common divisor (element-wise, singleton expansion) \matlab+gcd+, element-wise with singleton expansion. With $1$ input and $1$ output, computes the greatest common divisor of all elements of the input
475
+
Zd 1 2 2 1 3 1 true true if numel(in)==1 && numel(out)==1, x=in{1}(1); for t=in{1}(:).', x=gcd(x,t); end; out{1}=x; greatest common divisor (element-wise, singleton expansion) \matlab+gcd+, element-wise with singleton expansion. With $1$ input and $1$ output, computes the greatest common divisor of all elements of the input
470
476
else
471
477
if max(size(in{1}))==1 || max(size(in{2}))==1 || isequal(size(in{1}), size(in{2}))
Ym 1 4 1 1 1 1 true true out{1} = mean(in{:}); mean value \matlab+mean+
523
-
Zm 1 2 2 1 1 1 true true if numel(in)==1, x=1; for t=in{1}, x=lcm(x,t); end; out{1}=x; least common multiple (element-wise, singleton expansion) \matlab+lcm+, element-wise with singleton expansion. With $1$ input, computes the least common multiple of all elements of the input
529
+
Zm 1 2 2 1 1 1 true true if numel(in)==1, x=1; for t=in{1}(:).', x=lcm(x,t); end; out{1}=x; least common multiple (element-wise, singleton expansion) \matlab+lcm+, element-wise with singleton expansion. With $1$ input, computes the least common multiple of all elements of the input
524
530
else
525
531
if max(size(in{1}))==1 || max(size(in{2}))==1 || isequal(size(in{1}), size(in{2}))
Z| 2 3 2 1 1 1 true true if ischar(in{1}), in{1} = double(in{1}); end bit-wise logical 'or' (element-wise, singleton expansion) \matlab+bitor+, element-wise with singleton expansion. If first input is \matlab+char+ it is automatically converted to \matlab+double+
603
+
if max(size(in{1}))==1 || max(size(in{2}))==1 || isequal(size(in{1}), size(in{2}))
Y} 1 1 1 1 1 1 true true out{1} = cell2mat(in{:}); convert contents of cell array into single array \matlab+cell2mat+
608
-
Z} 1 1 1 0 inf numel(in{1}) true true outall = mat2cell(in{1}(:), ones(1,numel(in{1}))).'; split array into elements split array into its elements in linear order
615
+
Z} 1 2 1 0 inf prod(size(in{:})) true true if numel(in)==1, outall = mat2cell(in{1}(:), ones(1,numel(in{1}))).'; split array along a dimension split array into elements in linear order. With $2$ inputs: split into subarrays along the dimension indicated by the second input
616
+
elseif numel(in)==2, d = num2cell(size(in{1})); d{in{2}} = ones(1,size(in{1},in{2})); outall = mat2cell(in{1}, d{:}); outall = outall(:).'; clear d
617
+
else error('MATL:runtime', 'MATL run-time error: too many inputs'); end
609
618
out = outall(1:nout);
619
+
% The default nout, prod(size(in{:})), is either numel(in{1}) o size(in{1}, in{2})
620
+
% I considered defining Z} such that with 1 input it split along the first non-singleton dimension. But that gave me trouble. : The default nout should have been the size along the first non-singleton dimension or along the dimension indicated by the first output. : I didn't see how to define the default nout in a single statement. I tried size(in{1}, (numel(in)>1)*in{end} + (numel(in)==1)*[find(size(in{1})-1,1) repmat(1,1,numel(in{1})==1)]); but it didn't work when the first input was a cell array and there was not second input: in that case in{end} was not a number
Z~ 1 3 2 1 1 1 true true if numel(in)>=2 && isnumeric(in{2}) bit-wise logical 'xor' (element-wise, singleton expanstion) or complement bits \matlab+bitxor+, element-wise with singleton expansion. With $1$ numeric input (and optionally a second string input): \matlab+bitcmp+
624
+
Z~ 1 3 2 1 1 1 true true if ischar(in{1}), in{1} = double(in{1}); end bit-wise logical 'xor' (element-wise, singleton expanstion) or complement bits \matlab+bitxor+, element-wise with singleton expansion. With $1$ numeric input (and optionally a second string input): \matlab+bitcmp+. In both cases, if first input is \matlab+char+ it is automatically converted to \matlab+double+
625
+
if numel(in)>=2 && isnumeric(in{2})
614
626
if max(size(in{1}))==1 || max(size(in{2}))==1 || isequal(size(in{1}), size(in{2}))
0 commit comments