How do display whole digits of a number in exponent?

Hi,
I am using "text" command to display an expression in a plot. If C is a number like 1.96, when I use
text(x,y,sprintf( Q = A^%.2f',C))
it only shows the first character of C (I mean 1) in the exponent of A and the rest characters (.96) are not displayed in the exponent. How can I show all digits in the exponent?
Thanks, Asghar

 Respuesta aceptada

Oleg Komarov
Oleg Komarov el 29 de Mayo de 2012
text(x,y,sprintf('Q = A^{%.2f}',1.96))
Your question is related to the TEX typesetting functionality embedded in tetx(). By default, only the first character of a sequence is considered. You need to enclose the sequence of characters between { }.

Más respuestas (0)

Categorías

Más información sobre Graph and Network Algorithms en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Mayo de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by