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

回答 (1 件)

dpb
dpb 2016 年 12 月 3 日
編集済み: dpb 2016 年 12 月 4 日

0 投票

>> 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...

カテゴリ

ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索

タグ

質問済み:

2016 年 12 月 3 日

編集済み:

dpb
2016 年 12 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by