MATLAB: Odd (\\\r\n) output from symbolic multiplication

advanced symbolic toolboxadvanced symbolicsbugMATLABoddolddocssymbolicSymbolic Math Toolboxsymenginesyms

Hello!
So i'm doing some symbolic multiplication and the resulting expression output is quite long. However it includes one part of odd symbolics, namely: \\\r\n mixed inbetween the rest of the syms variables. I understand this is a line changing command but how can I remove this from the output? It is important since I need to compare if this symbolic output is equal to another expression.

Best Answer

The extra characters used on OS-X and Linux are \n\n rather than \r\n .
The extra characters only affects default display. It does not affect char() of the symbolic expression.
Note that both the default display and char() of the symbolic expression run the risk of:
Output truncated. Text exceeds maximum line length for Command Window display.
You can get around this by stepping into MuPAD:
feval(symengine, '_assign', 'TemporaryName', NameOfYourSymbolicVariable);
evalin(symengine, 'write(Text, "NameOfTheOutputFile.txt", TemporaryName)')
then NameOfTheOutputFile.txt will contain the full text.
By the way: the output file will be written into whichever directory was your current directory at the time you did the first your first symbolic command in this session (or, if you have done "clear all", then the current directory at the time of your first symbolic command since then.) You can give an absolute path for certainty.
Related Question