From 2752aaa46c00769b72e445e564c756368e736a90 Mon Sep 17 00:00:00 2001 From: Munsky Date: Fri, 15 Nov 2024 11:58:20 -0700 Subject: [PATCH] fix issue with omitnans in symbolic expressions (to use 'max' in prpensity functions. --- src/+ssit/@Propensity/Propensity.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/+ssit/@Propensity/Propensity.m b/src/+ssit/@Propensity/Propensity.m index dc903f2..371cab9 100644 --- a/src/+ssit/@Propensity/Propensity.m +++ b/src/+ssit/@Propensity/Propensity.m @@ -701,7 +701,14 @@ exprStr = char(symbolicExpression); % Get rid of max rules. -exprStr = char(strrep(exprStr,", [], 2, 'omitnan', false","")); +k = strfind(exprStr,', ''omitnan'); +if ~isempty(k) + exprStr = [exprStr(1:k-1),')']; +end + +% exprStr = char(strrep(exprStr,", [], 2, 'omitnan', false","")); + + opVar = {'*','/','^'}; for i = 1:length(opVar)