Fprintf question and application.
18 次查看(过去 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 中查找有关 MATLAB Compiler SDK 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!