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!