In symbolic expression, how can I factorize terms that has common variables?
Afficher commentaires plus anciens
I have this expression
det = 

I used collect but it returns the following
collect(det,x)
ans =

So, It has been factorized only with resect to x and x.^2 variables.
Is there a way to obtain the equation with the factorization with respect to all the variables?
Thank you ivery much in advance for your help!
Laura
6 commentaires
Walter Roberson
le 14 Juin 2021
You can pass a vector of variable names to collect()
laura bagnale
le 14 Juin 2021
laura bagnale
le 14 Juin 2021
Walter Roberson
le 14 Juin 2021
Modifié(e) : Walter Roberson
le 14 Juin 2021
syms a b c d e f g h i l x y
z = (2*a*h - 2*c*f)*x^2 + (4*a*g-4*b*f)*x*y + (d*h - c*i - 2 * e * f + 2 * a * l) * x
subs(z, 2*a*h-2*c*f, sym('-1.07'))
But I suspect you were looking for something more like
[C, p] = coeffs(z, x, 'all')
subs(z, C(1), sym('-1.07'))
laura bagnale
le 15 Juin 2021
laura bagnale
le 15 Juin 2021
Réponses (0)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






