convert double to string!
1,141 次查看(过去 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?
0 个评论
采纳的回答
Azzi Abdelmalek
2013-12-29
a=0.222833
a=sprintf('%.6f',a)
2 个评论
Azzi Abdelmalek
2013-12-29
%or
b=sprintf('%.20f',a);
idx=regexp(b,'0+','start');
b(idx(end):end)=[]
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!