How to get the factor format of a polynomial
241 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Moisés Antonio Fonseca Beltrán
el 17 de Abr. de 2021
Comentada: Alan Stevens
el 18 de Abr. de 2021
Hi,
I want to get the factorized format of a symbolic polynomial.
I know how to get the factors in symbolic way:
syms x
factor(x.^2-1)
ans =
[ x - 1, x + 1]
This is an array with factors.
But, I want to get as answer something like
(x - 1)*(x + 1)
how could I get it? I remember in ancient versions this was the result.
Do I have to build this expression?
In this case, any sugestion in order to make it?
Thanks in advance.
0 comentarios
Respuesta aceptada
Alan Stevens
el 17 de Abr. de 2021
syms x
y=x^2-1;
a = factor(y)
b = a(1)*a(2)
2 comentarios
Moisés Antonio Fonseca Beltrán
el 17 de Abr. de 2021
Editada: Moisés Antonio Fonseca Beltrán
el 17 de Abr. de 2021
Alan Stevens
el 18 de Abr. de 2021
Yes, it looks like you'll have to deal with the scalar factor by hand.
Más respuestas (0)
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!