Simple squaring of expression
2 ビュー (過去 30 日間)
古いコメントを表示
It has been some time since I last used MatLab, and I can't remember how to solve this simple problem. Given the expression:
(1*a+2*b+3*c+4*d+5*e-8)^2
How do you return an answer that actually multiples out the expression and puts like terms together?
I wrote the attached code, but this only returns:
(a + 2*b + 3*c + 4*d + 5*e - 8)^2
syms a
syms b
syms c
syms d
syms e
(1*a+2*b+3*c+4*d+5*e-8)*(1*a+2*b+3*c+4*d+5*e-8)
0 件のコメント
採用された回答
David Goodmanson
2019 年 7 月 11 日
HI Wesley,
syms a
syms b
syms c
syms d
syms e
f = expand((1*a+2*b+3*c+4*d+5*e-8)*(1*a+2*b+3*c+4*d+5*e-8))
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!