Fprintf question and application.
조회 수: 1 (최근 30일)
이전 댓글 표시
fprintf( '%7sVIII\n', 'Henry' )
fprintf( '%1sVIII\n', 'Henry' )
I can't understand the difference between the two. They have the same output. How does the field size value effect the fprintf?
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2015년 7월 14일
Write this, you will understand
fprintf( '%50sVIII\n', 'Henry' )
댓글 수: 3
Azzi Abdelmalek
2015년 7월 15일
편집: Azzi Abdelmalek
2015년 7월 15일
%50s, will be replaced by a string 'henry' with length equal to 50 characters, that's why you 45 blanks and the five character of 'Henry'.
VIII? because you add it!
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!