How do i do the reverse from expand function ?
12 ビュー (過去 30 日間)
表示 古いコメント
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 件のコメント
回答 (1 件)
Chidvi Modala
2021 年 11 月 19 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!