问题
Please consider this example. I would like to solve x^3 - 2x > 0. I try the following commands:
syms x;
f = @(x) x^3-2*x;
solve(f(x)>0,x)
and Matlab returns this
ans = solve([0.0 < x^3 - 2.0*x], [x])
which is not what I expect. Therefore I use
solve(f(x)+x>x,x)
which returns
ans = Dom::Interval(2^(1/2), Inf) Dom::Interval(-2^(1/2), 0)
Can someone explain that why solve
works successfully only in the second case?
回答1:
Try adding the Real
option to solve
:
solve(f(x)>0,x,'Real',1)
ans =
Dom::Interval(2^(1/2), Inf)
Dom::Interval(-2^(1/2), 0)
来源:https://stackoverflow.com/questions/23811199/unexpected-result-on-solving-some-inequality-in-matlab-symbolic-computation