フィルターのクリア

Why simple expression is not simplified (Symbolic Toolbox)?

2 ビュー (過去 30 日間)
Alex
Alex 2018 年 6 月 15 日
コメント済み: Walter Roberson 2018 年 6 月 15 日
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
  2 件のコメント
Alex
Alex 2018 年 6 月 15 日
But what assumption should I provide to Matlab to make this simplified to (1-b)^a?
Walter Roberson
Walter Roberson 2018 年 6 月 15 日
I am not sure. The obvious ones do not work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by