Output truncated. Text exceeds maximum line length for Command Window display. How to solve?

95 visualizaciones (últimos 30 días)
I have a problem that when I tried to display an answer, I got this message (Output truncated. Text exceeds maximum line length for Command Window display). I know that this is because the answer is too long.
My problem exactly is:
I need to do further processing on the result of f3Up. Exactly, I need to do two things:
1) Replace y1 to be y(1), then do the same thing for y2, y3, ... y10.
2) Replace the multiplication * to be .* and the same for / and ^ to make an element wise process.
I used to display the result, copy it, paste in a new file and then use the command (Replace) to do these two modifications I mentioned above. Now, I cannot display the full result, so I cannot do these modifications.
Can anyone help me with that.
I am using Matlab 2018a and this is an example of f3Up after shortening and deleting a lot of terms just to see what I want to do.
f3Up =(y1*cos((4014731262101775*t)/17592186044416)+5886768972981423*(((110680464442257306357*(44*pi)/5))/36893488147419103232000000 - sin... Output truncated. Text exceeds maximum line length for Command Window display.
Thanks in advance.

Respuesta aceptada

Star Strider
Star Strider el 10 de Sept. de 2018
The only options I can think of are:
f3Up = simplify(f3Up, 'Steps',20);
f3Up = vpa(f3Up, 5)
The first will do its best to simplify the function, by collecting terms and other operations, and the second replaces the long fractions by truncated decimal fractions, without losing any internal precision.
  7 comentarios
Hassan Alkomy
Hassan Alkomy el 17 de Sept. de 2018
Thank you very much. I appreciate your help. Your suggestion solved the problem.

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 11 de Sept. de 2018
Editada: Walter Roberson el 11 de Sept. de 2018
In a couple of releases, there was a bug where \r and \n characters could end up in the displayed output. There was a work-around for that, and there is a possibility that it might also affect the point at which output is truncated like you are observing.
Note, though, that the truncated bit is only for display purposes, and does not affect what is stored, so you should be able to store the results to a variable and manipulate it -- just don't use the copy/paste workflow (consider using matlabFunction or subs instead). There is also a way to get the symbolic engine to write out the MuPAD representation of an expression to a text file.
Workaround
Increase the value of the parameter TEXTWIDTH by using this command.
evalin(symengine, "TEXTWIDTH := 2^31-1");

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by