Allow diff(-diff(X)) or diff(-log(X)) in the LHS.

time-shift
Stéphane Adjemian (Charybdis) 2019-09-30 22:45:24 +02:00
parent fd2cb24911
commit 4f479bfbe8
1 changed files with 1 additions and 1 deletions

View File

@ -213,7 +213,7 @@ function [lhs, rhs] = getequation(str)
terms = strsplit(str, {'=',';'});
terms(cellfun(@(x) all(isempty(x)), terms)) = [];
terms(1) = {strrep(terms{1}, ' ', '')};
lhs = regexp(terms{1}, '^(diff\((log|diff)\([\-\+\*\/\w]*\)\)|(log|diff)\([\-\+\*\/\w]*\)|\w*)', 'match');
lhs = regexp(terms{1}, '^(diff\([\-]*(log|diff)\([\-\+\*\/\w]*\)\)|(log|diff)\([\-\+\*\/\w]*\)|\w*)', 'match');
if ~isempty(lhs)
lhs = lhs{1};
if isequal(lhs, 'log')