How to add zero infront of number
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Haziq
am 1 Mär. 2019
Beantwortet: Honglei Chen
am 1 Mär. 2019
Hi,
I have to add 0 before a number let say num = 2. I want to show as num=02
0 Kommentare
Akzeptierte Antwort
Honglei Chen
am 1 Mär. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!