问题
Why does the following return an empty solution?
syms a b positive integer
s = solve(a + b == 5, 'ReturnConditions', 1)
This does work:
s = solve([a + b <= 5, a + b >= 5], 'ReturnConditions', 1)
It seems that I had a problem in general solving a system with degrees of freedom:
Solving a symbolic equation system with degrees of freedom
The solution over there applies here:
s = solve(a + b == 5, [a b], 'ReturnConditions', 1)
来源:https://stackoverflow.com/questions/65748247/solving-a-symbolic-equation-with-integer-variables