Can you turn off all simplifications?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I need to do some basic algebra and want to use MuPad as a "check my work" tool. However I can't turn off all simplifications! I want MuPad to _not_ simplify fractions etc, instead leave them in raw (original number) form.
0 comentarios
Respuestas (2)
Stefan Wehmeier
el 1 de Jun. de 2012
It's a bit tricky. hold(4/6) will not help you because 4/6 -> 2/3 is done by the parser. You will have to define "frozen" forms of all operators you use, e.g. mydiv:= freeze(_divide); mydiv(4, 6)
If you want to use infix notation for your "frozen" functions, you have to link them to infix operator symbols - see ?operator. If, much later, you want the computation to be done - how else could you check your work? - then apply unfreeze to your final result. You could also use hold(_divide)(4, 6) but then it is much more difficult to prevent unwanted simplifications later on. Some of the tricks explained in ?Pref::postInput may also be of interest.
0 comentarios
Walter Roberson
el 22 de Mayo de 2012
I have not read the MuPAD documentation in enough detail to be really sure, but I believe the answer is NO, that it is not possible to turn off automatic simplification of numeric constant expressions. For example, 1 + 1 will be replaced by 2.
You might be able to take advantage of hold().
If not, convert the numbers to symbols or strings. But that risks replacing (e.g.) `1` + `1` with 2*`1`
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!