write 10 alphabets in one line
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
how to write a program that writes 10 alphabets in each lines like after J which is the tenth it will switch line and then after T
Thank you for your help
0 comentarios
Respuestas (1)
dpb
el 3 de Dic. de 2016
Editada: dpb
el 4 de Dic. de 2016
>> sprintf([repmat('%c',1,10) '\n'],'A':'Z')
ans =
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ
>>
ADDENDUM Above returns an string; if only purpose is to either display or write to file, fprintf is more suitable...all depends on what actually after as end result here...
0 comentarios
Ver también
Categorías
Más información sobre Language Fundamentals 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!