MATLAB: How to change integer format

double

how to make the double value format… like 02 instead of 2 ?

Best Answer

fprintf('%0.2d\n',2)
02
fprintf('%0.2d\n',3)
03
fprintf('%0.4d\n',3)
0003