How to add zero infront of number

조회 수: 2 (최근 30일)
Muhammad Haziq
Muhammad Haziq 2019년 3월 1일
답변: Honglei Chen 2019년 3월 1일
Hi,
I have to add 0 before a number let say num = 2. I want to show as num=02

채택된 답변

Honglei Chen
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개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by