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 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!