Prevent Live Script From Rearranging Input
조회 수: 15 (최근 30일)
이전 댓글 표시
I'm trying to use a Live Script to manipulate a couple of long equations symbolically.
Unfortunately, whenever I enter an equation, the script rearranges my input (changes the order of terms, divides through by a common denominator, ect). While the resulting expression is mathematically equivalent to my input, it's very tedious to error check my code. I have to perform a bunch of algebra by hand on the expression produced by the Live Script to make sure that it's the same as my input expression.
Is there a way to prevent the Live Script from rearranging my input (i.e. preseve the order of terms and the grouping of terms)?
For example:
syms a b c d
a = ((c + d)*3 - b*2)/8
produces the output:

I'd like the displayed expression to preserve the grouping and arangement of the input.
Does anyone know how to do this?
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 4월 15일
This is not possible with the MATLAB interface to the MuPad symbolic engine. The MuPad engine itself has a facility to "hold" an expression https://www.mathworks.com/help/symbolic/mupad_ref/hold.html but the MATLAB interface does not know about that and makes no attempt to respect it and does not know how to format it.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!