How do I get pretty symbolic expressions in MATLAB using fancy?

137 visualizaciones (últimos 30 días)
Julio Cesar
Julio Cesar el 1 de Feb. de 2011
Editada: Walter Roberson el 25 de Jul. de 2015
Do you remember how to use the Fancy() function? I only found this http://www.mathworks.com/matlabcentral/newsreader/view_thread/12223
I would like to show in a fancy format all the outputs in the command line I get this error
>> fancy(x^2)
??? Undefined function or variable 'x'.
What do I need to install?

Respuestas (4)

Paulo Silva
Paulo Silva el 1 de Feb. de 2011
syms x
pretty(x^2)

Davide Ferraro
Davide Ferraro el 1 de Feb. de 2011
The FANCY function on the MATLAB newsgroup is not part of standard MATLAB. To make use of that code you need to copy it from the discussion in a new MATLAB file and save it in the MATLAB path.
If you are working with symbolic objects (that need Symbolic Math Toolbox) you can use the PRETTY command that is directly available with the toolbox.
A = sym(pascal(2))
B = eig(A)
pretty(B)

Julio Cesar
Julio Cesar el 4 de Feb. de 2011
Where can I get the .m file? The file in the previous link did not work. thank you
  1 comentario
Walter Roberson
Walter Roberson el 4 de Feb. de 2011
Please clarify as to which link did not work.
The newsgroup discussion includes the complete source for fancy() in it, but fancy() is for setting via LaTex using a particular Windows LaTex implementation. The pretty() command is built in to MuPad, but that requires that you have the Symbolic Toolbox. If your version of Matlab is old enough that you are using Maple as the symbolic engine, I am not certain that pretty() was available; pretty() is not part of the Maple language.

Iniciar sesión para comentar.


Julio Cesar
Julio Cesar el 5 de Feb. de 2011
Editada: Walter Roberson el 25 de Jul. de 2015
Pretty() worked fine, I on ly have this link http://www.mathworks.com/matlabcentral/newsreader/view_thread/12223
Could you please share the newsgroup discussion link?
thanks in advance
  1 comentario
Walter Roberson
Walter Roberson el 5 de Feb. de 2011
That *is* the newsgroup discussion link, and the source for fancy() is message #4 of 4 in the series.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by