how to print E formated numbers.
Mostrar comentarios más antiguos
I have numbers such as 0.1032E-02 (say) If I read this as x = 0.1032E-02 and save it to a text file using fopen, and fprintf fid = fopen('Testing.txt','wt'); fprintf(fid, '%15.5E\n',x) it always prints x as 1.032E-03 but I would like the 0 in front just as the way I assigned the value to x. How do i do it?
2 comentarios
@Pappu Murthy: Numeric data classes do not store any formatting, so printing a number "just as the way I assigned the value to x" is not possible in general: a value will simply be displayed according to the fprintf specification. With that in mind: if you need to convert to numeric, do you always want a leading zero in the printed output?
Pappu Murthy
el 8 de Mzo. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Scripts en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!