How do display whole digits of a number in exponent?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Oleg Komarov
2012년 5월 29일
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 { }.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!