Is it possible to display negative integer exponentials in MATLAB's MuPAD Symbolic Notebook?
3 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2009 年 8 月 27 日
コメント済み: Pouya Jamali
2013 年 12 月 20 日
I would like get MuPAD to give me back polynomials with negative integer exponentials instead of displaying them in the rational form. For example, the following code in the MuPAD
% THIS CODE SHOULD BE WRITTEN IN THE MUPAD NOTEBOOK
[ f := (b0 * z^(2) + b1 * z^(1) + b2) / z^(2)
gives me:
[ 1/z^2*(b0*z^2 + b1*z + b2)
I would like to "simplify" this to
[ b0 + b1 * z^(-1) + b2 * z^(-2)
This would mainly be useful for me when creating and displaying a Laurent Polynomial.
採用された回答
MathWorks Support Team
2009 年 8 月 27 日
The ability to directly display negative exponents is not available in MuPAD .
A workaround would be to place all the exponents into a domain that hides the negative signs from the output code for a while. As an example, try running the following code in the MuPAD Notebook:
domain expo
new := e -> new(dom, e);
print := e -> extop(e, 1);
end:
Pref::output(ex -> misc::maprec(ex,
{"_power"} = (ex -> subsop(ex, 2 = expo(op(ex, 2)), Unsimplified)))):
f := (b0 * z^(2) + b1 * z^(1) + b2) / z^(2);expand(f)
Note that this has the side effect of breaking the display of all fractions other than rational numbers. However, one can create a domain for the Laurent series that does something like the example shown for the exponents of the series variable and only there. That would ensure that the order of the terms is fixed and that the z factor is always the last in the product.
1 件のコメント
Pouya Jamali
2013 年 12 月 20 日
Tanx. Could you please explain more about the method to define appropriate domain you've mentioned?
I like to have a Laurent Polynomial too. but the suggested domain above, doesn't ensure the reducing order of z.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!