keep scientific notation in plot title
조회 수: 19 (최근 30일)
이전 댓글 표시
I have a variable in scientific notation as
a=1.2310^-3
if I use
b=string(a)
to add b to a plot title
I get in the title
0.000123
any way to avoid this and keep in the title 1.23^-3 ???
Thanks
Renzo
댓글 수: 0
답변 (1개)
Rik
2020년 5월 24일
If you want a specific notation you can enforce that with the sprintf function. Otherwise Matlab will automagically pick a format for you.
댓글 수: 2
Rik
2020년 5월 24일
In this situation num2str will do the trick, but in the future you would probably need to look into the sprintf function.
참고 항목
카테고리
Help Center 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!