Prevent Live Script From Rearranging Input
2 次查看(过去 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!