Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LRT_infinite_dimensional_systems
conI
Commits
7390ebcb
Commit
7390ebcb
authored
Jul 10, 2019
by
Ferdinand Fischer
Browse files
Fixed bug in horizontal concatenation of empty quantities
parent
a5ab6d48
Changes
2
Hide whitespace changes
Inline
Side-by-side
+quantity/Discrete.m
View file @
7390ebcb
...
...
@@ -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
...
...
+unittests/+quantity/testDiscrete.m
View file @
7390ebcb
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment