fix bug in handling unary minus node as uminus is not a valid dseries operation

time-shift
Houtan Bastani 2019-02-05 19:52:12 +01:00
parent 8fdf805f1f
commit de573890b7
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 5 additions and 1 deletions

View File

@ -342,7 +342,11 @@ elseif strcmp(node.node_type, 'UnaryOpNode')
% Only works if dseries supports . notation for unary op (true for log/diff)
% Otherwise, use: X = eval([node.op '(Xtmp)']);
try
X = Xtmp.(node.op);
if strcmp(node.op, 'uminus')
X = -Xtmp;
else
X = Xtmp.(node.op);
end
if any(isinf(X)) || ~isreal(X)
parsing_error(['Error applying ' node.op], line, node);
end