convert double to string!

1,133 次查看(过去 30 天)
I want convert double number like 0.222833 to string but when i using num2str the number convert to '0.22283' and sixth digit of number is removed ,can u help me to convert it to string?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-12-29
a=0.222833
a=sprintf('%.6f',a)
  2 个评论
fatemeh
fatemeh 2013-12-29
thank you very much
Azzi Abdelmalek
Azzi Abdelmalek 2013-12-29
%or
b=sprintf('%.20f',a);
idx=regexp(b,'0+','start');
b(idx(end):end)=[]

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by