Add option to set the numbers of 0s when exporting runs sprintf('%2.2d'); % 01 sprintf('%3.3d'); % 001