Commit 7390ebcb authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Fixed bug in horizontal concatenation of empty quantities

parent a5ab6d48
......@@ -494,7 +494,13 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
% if there are only empty entries, nothing can be
% concatenated, so a new empty object is initialized.
s = cellfun(@(o) size(o), objCell, 'UniformOutput', false);
S = sum(cat(3, s{:}), 3);
if dim == 1
S = sum(cat(3, s{:}), 3);
elseif dim == 2
S = s{1};
else
error('Not implemented')
end
c = quantity.Discrete.empty(S);
return
else
......
......@@ -77,6 +77,13 @@ testCase.verifyTrue(all(size(AC) == [4, 1]));
A0s = [A, zeros(2,3)];
testCase.verifyTrue(all(all(all(A0s(:, 2:end).on() == 0))))
O = quantity.Discrete.empty([5, 0]);
O_horz = [O, O];
O_vert = [O; O];
testCase.verifyEqual(size(O_horz, 1), 5);
testCase.verifyEqual(size(O_vert, 1), 10);
end
function testExp(testCase)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment