Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
fprintf function question about
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fprintf('that will be $ %5.2f ....)
I know .2 mean 2 decimal place, but what is 5 mean here. Thanks.
0 Kommentare
Antworten (1)
Image Analyst
am 19 Feb. 2013
It means that the field width will be padded so that it will be at least 5 characters, like "12.34" or " 1.23" - Note the last case has a space added. You don't need to use the first number - I never do. Just use '%.2f' and you'll be fine. You only need to use it if you want to print a bunch of things with different sizes and want them to be all aligned. But normally you don't use it.
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!