convert double to string!
1.178 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
fatemeh
il 29 Dic 2013
Commentato: Azzi Abdelmalek
il 29 Dic 2013
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 Commenti
Risposta accettata
Azzi Abdelmalek
il 29 Dic 2013
a=0.222833
a=sprintf('%.6f',a)
2 Commenti
Azzi Abdelmalek
il 29 Dic 2013
%or
b=sprintf('%.20f',a);
idx=regexp(b,'0+','start');
b(idx(end):end)=[]
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!