Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

fprintf function question about

조회 수: 2 (최근 30일)
THANH NGUYEN
THANH NGUYEN 2013년 2월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
fprintf('that will be $ %5.2f ....)
I know .2 mean 2 decimal place, but what is 5 mean here. Thanks.

답변 (1개)

Image Analyst
Image Analyst 2013년 2월 19일
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.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by