Fprintf question and application.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hussain Hayat
el 14 de Jul. de 2015
Comentada: Hussain Hayat
el 15 de Jul. de 2015
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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 14 de Jul. de 2015
Write this, you will understand
fprintf( '%50sVIII\n', 'Henry' )
3 comentarios
Azzi Abdelmalek
el 15 de Jul. de 2015
Editada: Azzi Abdelmalek
el 15 de Jul. de 2015
%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!
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!