Why simple expression is not simplified (Symbolic Toolbox)?

3 次查看(过去 30 天)
Quite simple code
syms a b
assume(a,'real');
assume(b,'real');
simplify((-1)^a*(b-1)^a)
The answer is obviously (1-b)^a, but Matlab does not simplify it? Why? How to make it work?
Thank you!

采纳的回答

Walter Roberson
Walter Roberson 2018-6-15
That is not a correct solution.
Let b = -31, let a = 3/5
simplify((1-(-31))^(3/5));
8
simplify((-1)^(3/5)*((-31)-1)^(3/5));
(1/5)
-8 (-1)
evalf(%);
-6.472135955 - 4.702282018 I

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by