Posts

Showing posts from November 24, 2018

“Unable to prove `expr` literally…” error when trying to compare a symbol inside a function

Image
up vote 1 down vote favorite I just started learning MATLAB and I'm trying to normalize a bump function given by function b = bump(x) region1 = abs(x) < 1 b(region1) = (exp(-1./(1 - x(region1).^2))) region2 = abs(x) >= 1 b(region2) = 0 end To do this, I need to divide by the definite integral from -1 to 1. However, when I input syms x; int(bump(x), -1, 1) I get a long error message, which says Error using symengine (line 58) Unable to prove 'abs(x) < 1' literally. To test the statement mathematically, use isAlways. Error in sym/subsindex (line 1554) X = find(mupadmex('symobj::logical',A.s,9)) - 1; Error in sym>privformat (line 2357) x = subsindex(x)+1; Error in sym/subsref (line 1578) [inds{k},refs{k}] = privformat(inds{k}); Error in bu