Commit 17caba0d authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Fixed bug in quantity.Symbolic/subs which ourred if (z, zeta) domain should be...

Fixed bug in quantity.Symbolic/subs which ourred if (z, zeta) domain should be exchanged with (zeta, z).
parent 04f4467a
......@@ -313,7 +313,7 @@ classdef Symbolic < quantity.Function
resultingName = [newDomain.name];
for it = 1 : numel(gridName2ReplaceSymbolicOld)
resultingName(strcmp(resultingName, gridName2ReplaceSymbolicOld(it))) ...
resultingName(strcmp([newDomain.name], gridName2ReplaceSymbolicOld(it))) ...
= gridName2ReplaceSymbolicNew(it);
end % for it = 1 : numel(gridName2ReplaceSymbolicOld)
if misc.isunique(resultingName)
......
......@@ -870,8 +870,12 @@ end
function testSubs3(tc)
zZeta = [quantity.Domain("z", linspace(0, 1, 11)), quantity.Domain("zeta", linspace(0, 1, 11))];
Id = quantity.Symbolic(eye(2), zZeta);
tc.verifyEqual(Id.subs("z", 1).on(), Id.subs("z", "zeta").on(), 'AbsTol', 10*eps);
Id = quantity.Symbolic([sym("z"), 1; 2 sym("zeta")], zZeta);
Id_z1 = quantity.Symbolic([1, 1; 2 sym("zeta")], zZeta.find("zeta"));
Id_zetaZ = quantity.Symbolic( [sym("zeta"), 1; 2 sym("z")], zZeta([2 1]));
tc.verifyEqual(Id.subs("z", 1).on(), Id_z1.on(), 'AbsTol', 10*eps);
tc.verifyEqual( Id.subs({"z", "zeta"}, {"zeta", "z"}).on(), Id_zetaZ.on())
end % testSubs3()
function testSubs2(tc)
......
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