Filter löschen
Filter löschen

write 10 alphabets in one line

1 Ansicht (letzte 30 Tage)
Hamid Bakht
Hamid Bakht am 3 Dez. 2016
Bearbeitet: dpb am 4 Dez. 2016
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

Antworten (1)

dpb
dpb am 3 Dez. 2016
Bearbeitet: dpb am 4 Dez. 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...

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by