get only addends of subexpression
1 回表示 (過去 30 日間)
古いコメントを表示
David Armendáriz
2018 年 3 月 15 日
コメント済み: Walter Roberson
2018 年 3 月 15 日
Suppose I have a symbolic expression like this
syms x x0
f=(x-x0)^3
children(f)
[(x-x0),3]
I would like to get instead
[(x-x0)^3]
How can this be done?
1 件のコメント
Steven Lord
2018 年 3 月 15 日
Can you say a little more about your ultimate goal? Perhaps there's a way to do what you want without running a MuPAD expression via feval(symengine, ...).
採用された回答
Walter Roberson
2018 年 3 月 15 日
You cannot do that with children().
You need to do something like,
feval(symengine, '(V) -> if testtype(V,"_plus") then [op(V)] else [V] end_if;', f)
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MuPAD についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!