How to change integer format

6 visualizaciones (últimos 30 días)
Belal Arar
Belal Arar el 29 de Dic. de 2016
Comentada: Mohammad Abouali el 29 de Dic. de 2016
how to make the double value format... like 02 instead of 2 ?

Respuesta aceptada

Mohammad Abouali
Mohammad Abouali el 29 de Dic. de 2016
Editada: Mohammad Abouali el 29 de Dic. de 2016
fprintf('%0.2d\n',2)
02
fprintf('%0.2d\n',3)
03
fprintf('%0.4d\n',3)
0003
  2 comentarios
Belal Arar
Belal Arar el 29 de Dic. de 2016
thank you man :)
Mohammad Abouali
Mohammad Abouali el 29 de Dic. de 2016
You are welcome

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by