keep scientific notation in plot title
显示 更早的评论
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
回答(1 个)
Rik
2020-5-24
0 个投票
If you want a specific notation you can enforce that with the sprintf function. Otherwise Matlab will automagically pick a format for you.
2 个评论
Lorenzo Mattera
2020-5-24
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!