How to add zero infront of number
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Muhammad Haziq
el 1 de Mzo. de 2019
Respondida: Honglei Chen
el 1 de Mzo. de 2019
Hi,
I have to add 0 before a number let say num = 2. I want to show as num=02
0 comentarios
Respuesta aceptada
Honglei Chen
el 1 de Mzo. de 2019
I don't think you can pad zero for a numeric number but you can do it when printing. For example
fprintf('num = %02d\n',2)
Is this what you want? HTH
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!