How can I align text to be left-justified using fprintf?
33 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
While using fprintf I would get text that aligns at the end of the word by default. I need it to be able to align at the beginning or left hand side of the word. Thanks.
0 comentarios
Respuestas (1)
dpb
el 2 de Abr. de 2014
>> fprintf('%10s\n','abcdef')
abcdef
>> fprintf('%-10s\n','abcdef')
abcdef
>>
doc fprintf
read up on format string in the links thereto...
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!