Skip to content
GitLab
Menu
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
ad211f18
Commit
ad211f18
authored
Oct 29, 2020
by
Ferdinand Fischer
Browse files
Let quantity.Discrete/subs handle empty quantities
parent
b96aca6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
+quantity/Discrete.m
View file @
ad211f18
...
...
@@ -1042,22 +1042,23 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete ...
[
newValues
,
oldDomainName
]
=
quantity
.
Discrete
.
subsParser
(
oldDomainName
,
varargin
);
solution
=
copy
(
obj
);
for
it
=
1
:
numel
(
oldDomainName
)
if
isstring
(
newValues
{
it
})
% if newValues{it} is a string, it is converted in a domain, to use the same
% implementation as for quantity.Domain-objects in newValues.
newValues
{
it
}
=
solution
(
1
)
.
domain
.
find
(
oldDomainName
(
it
))
.
rename
(
newValues
{
it
},
oldDomainName
(
it
));
end
if
isnumeric
(
newValues
{
it
})
solution
=
solution
.
subsNumeric
(
oldDomainName
(
it
),
newValues
{
it
});
else
solution
=
solution
.
subsDomain
(
oldDomainName
(
it
),
newValues
{
it
});
end
% if-else
end
% for it = 1 : numel(oldDomainName)
if
~
isempty
(
solution
)
for
it
=
1
:
numel
(
oldDomainName
)
if
isstring
(
newValues
{
it
})
% if newValues{it} is a string, it is converted in a domain, to use the same
% implementation as for quantity.Domain-objects in newValues.
newValues
{
it
}
=
solution
(
1
)
.
domain
.
find
(
oldDomainName
(
it
))
.
rename
(
newValues
{
it
},
oldDomainName
(
it
));
end
if
isnumeric
(
newValues
{
it
})
solution
=
solution
.
subsNumeric
(
oldDomainName
(
it
),
newValues
{
it
});
else
solution
=
solution
.
subsDomain
(
oldDomainName
(
it
),
newValues
{
it
});
end
% if-else
end
% for it = 1 : numel(oldDomainName)
end
% if - isempty
end
% subs()
function
solution
=
subsNumeric
(
obj
,
oldDomainName
,
value
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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