Fixed replacement of LHS variable if the equation has no lag.

time-shift
Stéphane Adjemian(Charybdis) 2018-07-13 19:10:25 +02:00
parent 9b51b1ee16
commit 2256acfa73
1 changed files with 5 additions and 1 deletions

View File

@ -163,7 +163,11 @@ for i=1:length(objNames)
rhs = regexprep(rhs, ['\<' objNames{i} '\>'], sprintf('data(:,%u)', k));
end
if contains(lhs, objNames{i})
lhs = strrep(lhs, objNames{i}, sprintf('data(2:end,%u)', k));
if islaggedvariables
lhs = strrep(lhs, objNames{i}, sprintf('data(2:end,%u)', k));
else
lhs = strrep(lhs, objNames{i}, sprintf('data(:,%u)', k));
end
end
end
end