isolate function is not providing multiple solutions to a polynomial problem?

18 visualizaciones (últimos 30 días)
Uddhav Surve
Uddhav Surve el 2 de Dic. de 2024 a las 14:01
Respondida: Star Strider el 2 de Dic. de 2024 a las 14:19
I used the "isolate function" as per matlab documentation, https://in.mathworks.com/help/symbolic/sym.isolate.html
The first example shown for isolating 'x' from a quadratic equation gives only one root as output. Can someone explain how to get other root of quadratic as output?
Isolate Variable in Equation
Isolate x in the equation a*x^2 + b*x + c == 0.
----------------------------------------------------------------------------
syms x a b c
eqn = a*x^2 + b*x + c == 0;
xSol = isolate(eqn, x)
-----------------------------------------------
xSol =
x == -(b + (b^2 - 4*a*c)^(1/2))/(2*a)

Respuestas (1)

Star Strider
Star Strider el 2 de Dic. de 2024 a las 14:19
Apparently isolate does not, however solve does —
syms x a b c
eqn = a*x^2 + b*x + c == 0;
xSol = solve(eqn, x)
pretty(xSol)
/ 2 \ | b + sqrt(b - 4 a c) | | - -------------------- | | 2 a | | | | 2 | | b - sqrt(b - 4 a c) | | - -------------------- | \ 2 a /
.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by