MATLAB Answers

Changing Format of Symbolic Expression

3 views (last 30 days)
Lukas Lundgren
Lukas Lundgren on 28 Oct 2019
Commented: Lukas Lundgren on 28 Oct 2019
I am trying out some symbolic expressions in Matlab and was wondering if I could change the format of the result?
Basically I have written a script that produces a 4x4 matrix consisting out of rather long expressions. These expressions are presented afterwards like this
This is not very easy to read and I would like the expression to just be a long expression. Not one divided into parts. Is this possible?
Here is my code


Walter Roberson
Walter Roberson on 28 Oct 2019
You appear to be looking in the Variable Explorer. As best I recall, there is no way to control the format of symbolic expressions there.
In the command window, when disp() is being used, then "one long expression" is the default, and getting the arrangement like you posted a copy of requires using pretty()
Note: the rules are probably different in LiveScript. You might need to char() the symbolic expression in LiveScript, perhaps.
Lukas Lundgren
Lukas Lundgren on 28 Oct 2019
I forgot to mention that the display command gave me the same result. However the char command worked! Thank you very much Walter Roberson!

Sign in to comment.

Answers (0)

Sign in to answer this question.