How do I add leading zero to integer string in MATLAB 7.8 (R2009a)?
Show older comments
I want to form a string that has some text, and a number formed by using an integer.
For example, if the integer is 5, I want to form a string -
'SomeText05'. If the integer is 15, I want to form 'SomeText15'.
Strcat('SomeText', int2str(15)) gives me SomeText15, but
strcat('SomeText', int2str(5)) gives me SomeText5. I want SomeText05.
I do not know what format string I should use to get the leading zero before 5.
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!