could anyone help me how to display 1 as 1.0000
4 次查看(过去 30 天)
显示 更早的评论
i want to display the round number with decimal value 0.
I am having number 1.I want to display it as 1.0000(adding four decimal zeros)
could anyone please help me on it.
1 个评论
Adam
2019-8-6
Display it where? On command line or on a GUI or somewhere else?
doc sprintf
should do that if you just want to view a specific instance, e.g.
x = 1;
sprintf( '%.4f', x )
but it depends entirely where you want it and for what purpose.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!