How do I print a '%' character using SPRINTF in MATLAB 7.7 (R2008b)?
Show older comments
I would like to print a string containing the '%' character. However, when I attempt the following:
sprintf('100%')
The output reads:
100
Accepted Answer
More Answers (1)
Walter Roberson
on 23 Nov 2017
sprintf('%s', '100%')
The % are only "eaten" if they occur in the first parameter, the format position.
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!