Evaluating polynomial functions to get integer as answer
Ältere Kommentare anzeigen
I am trying to evaluate:
syms x y
eq = (x^2 + y^3 == 31)
solve(eq)
eqs = [x^2 + y^3 == 31, x^2 == 31 - y^3]
S = solve(eq,[x y])
S.x and S.y still not 2 and 3
i am expecting to get as answer two integer: x=2 and y=3. How can i do it?
Thanks
Akzeptierte Antwort
Weitere Antworten (1)
darova
am 4 Apr. 2021
1 Stimme
solve can be used for simple problems. Use fsolve or vpasolve to get numerical results
1 Kommentar
Walter Roberson
am 4 Apr. 2021
Not the point. The point is that solve() is having difficulty processing integer constraints in this case. fsolve and vpasolve have no chance of processing integer constraints.
Kategorien
Mehr zu Assumptions finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!