How to add zero infront of number
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have to add 0 before a number let say num = 2. I want to show as num=02
0 件のコメント
採用された回答
Honglei Chen
2019 年 3 月 1 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!