Commit 0153f0cc authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Extended input check for quantity.Discrete/changeGrid, the input gridNew is...

Extended input check for quantity.Discrete/changeGrid, the input gridNew is verified to be a numeric value
parent 7f1a1240
......@@ -1394,8 +1394,11 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete ...
gridNameNew = [gridNew.name];
gridNew = {gridNew.grid};
else
gridNameNew = misc.ensureString(gridNameNew);
gridNameNew = misc.ensureString(gridNameNew);
gridNew = misc.ensureIsCell(gridNew);
for it = 1:numel(gridNew)
assert( isnumeric( [gridNew{it}] ), "The gridNew parameter must be a cell array of numeric arrays." )
end
end
if obj(1).isConstant
......@@ -2780,4 +2783,4 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete ...
end % methods (Access = protected)
end % classdef
\ No newline at end of file
end % classdef
......@@ -40,4 +40,13 @@ EE(1:2) = quantity.Domain();
EE(1) = e;
EE(2) = d;
end
function testSubs(testCase)
f = quantity.Discrete((1:5)', quantity.EquidistantDomain("t", 0, 1, "stepNumber", 5));
f.subs("t", 1)
f.changeGrid(quantity.Domain("t", linspace(0,1)))
end
\ No newline at end of file
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