Added the possibility to change more than one variable name in an equation.
parent
d136be8a84
commit
0aa78c6914
|
@ -89,16 +89,19 @@ for i=1:length(eqtags)
|
||||||
if isrename
|
if isrename
|
||||||
[variable_has_to_be_renamed, id] = ismember(eqnum, [rename{:,1}]);
|
[variable_has_to_be_renamed, id] = ismember(eqnum, [rename{:,1}]);
|
||||||
if variable_has_to_be_renamed
|
if variable_has_to_be_renamed
|
||||||
tmp = strsplit(rename{id,2}, '->');
|
TMP = strsplit(rename{id,2}, ',');
|
||||||
lhs_expression = exactstrrep(lhs_expression, tmp{1}, tmp{2});
|
for j=1:length(TMP)
|
||||||
RHS = exactstrrep(RHS, tmp{1}, tmp{2});
|
tmp = strsplit(TMP{j}, '->');
|
||||||
rep = strcmp(tmp{1}, enames);
|
lhs_expression = exactstrrep(lhs_expression, tmp{1}, tmp{2});
|
||||||
if any(rep)
|
RHS = exactstrrep(RHS, tmp{1}, tmp{2});
|
||||||
enames(rep) = tmp(2);
|
rep = strcmp(tmp{1}, enames);
|
||||||
end
|
if any(rep)
|
||||||
rep = strcmp(tmp{1}, xnames);
|
enames(rep) = tmp(2);
|
||||||
if any(rep)
|
end
|
||||||
xnames(rep) = tmp(2);
|
rep = strcmp(tmp{1}, xnames);
|
||||||
|
if any(rep)
|
||||||
|
xnames(rep) = tmp(2);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue