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!