Prevent Live Script From Rearranging Input

1 visualización (últimos 30 días)
Lawrence Smith
Lawrence Smith el 15 de Abr. de 2019
Respondida: Walter Roberson el 15 de Abr. de 2019
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?

Respuestas (1)

Walter Roberson
Walter Roberson el 15 de Abr. de 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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by