Prevent Live Script From Rearranging Input
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 15 Apr 2019
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!