Borrar filtros
Borrar filtros

Plot as a decimal and not a fraction

1 visualización (últimos 30 días)
Marisabel Gonzalez
Marisabel Gonzalez el 30 de Dic. de 2018
Editada: Star Strider el 30 de Dic. de 2018
xtext = ['$\it{\bf{(A_{B}C)^{',rats(m),'}}}$'];
xlabel(xtext,'Interpreter','Latex','FontSize', 15 )
This is my code for my xlabel.
m, the slope, is always returned as a fraction and not as a decimal.
when I type "format bank" on the line before I still get the same result in my xlabel

Respuesta aceptada

Star Strider
Star Strider el 30 de Dic. de 2018
Editada: Star Strider el 30 de Dic. de 2018
The rats (link)call will produce a fraction.
Change that to something else if you want a decimal output.
Example —
m = pi;
xtext = sprintf('$\\it{\\bf{(A_{B}C)^{%.2f}}}$', m)
produces:
  1 comentario
Marisabel Gonzalez
Marisabel Gonzalez el 30 de Dic. de 2018
when I just call m it messes up my latex.
What can I do?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by