How do i do the reverse from expand function ?
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have an expression lets say
a^2_2*a*b+b^2+b
and i want to simplify the expression to get
(a+b)^2+b
what is the proper way of doing this ?
0 comentarios
Respuestas (1)
Chidvi Modala
el 19 de Nov. de 2021
Hi Tomer,
In general, you may use simplify(expr) function to perform algebraic simplification of expr. But simplify currently has some known issue with the simplification of sums. It cannot simplify your entire expression "a^2+2*a*b+b^2+b", but it can simplify "a^2+2*a*b+b^2" to "(a+b)^2". You may use the following example as a workaround.
syms a b;
simplify(expand(a^2+2*a*b+b^2)) + b
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!