From 4f479bfbe8c9076bc38711617365b5dd2b8d2c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 30 Sep 2019 22:45:24 +0200 Subject: [PATCH] Allow diff(-diff(X)) or diff(-log(X)) in the LHS. --- matlab/aggregate.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/aggregate.m b/matlab/aggregate.m index dbdb6c92b..dea0fb4df 100644 --- a/matlab/aggregate.m +++ b/matlab/aggregate.m @@ -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')